I have gtf file containing 7 columns from which i am going extract only gene name part from column 7th.

The 7th column contains some information including `gene_id`, `gene_name` and so on that I posted one row of column 7th below:

    gene_id "XLOC_000001"; transcript_id "TCONS_00000001"; exon_number "1"; gene_name "NAC001"; oId "AT1G01010.1"; nearest_ref "AT1G01010.1"; class_code "="; tss_id

I need only `gene_name` from this column, for example "NAC001", how can I extract which I need please?
Assuming the fields in your gtf are tab separated you could try something like this:

    awk 'BEGIN{FS="\t"}{print $7}' YOURFILE | awk 'BEGIN{FS="gene_name"}{print $2}' | awk 'BEGIN{FS=";"}{print $1}' > OUTFILE

<a href="https://www.biostars.org/u/18713/">genomax2</a> solution with sub is nicer.