I have this problem so i want to take out all the exon coordinates and their respective sequences .One way is I take out the coordinates of exon from a gtf file then give that as input to ucsc genome browser  , i get the DNA sequences ,but it looks like i get intronic sequences too.

So any suggestion or help how to do it better way .I m not how to proceed .As always sugesiton or help would highly appreciated 
I did it like that: 

1- Download [refGene.txt.gz][1] and [hg19.fasta][2] from the UCSC goldenpath. ( note: convert hg19.2bit to hg19.fa using [twoBitToFa][3] )   
2- Create a bed file with exon coordiniate using my [awk script][4]


     // to_transcript.awk 

    BEGIN 
    {
     OFS ="\t"
    }
    {
    	name=$2
    	name2=$13
    	sens = $4 =="+" ? "forward" : "reverse"
    	chrom=$3
    
    	split($10,exon_starts,",")
    	split($11,exon_ends,",")
    
    
    	for (i=1; i<length(exon_starts); i++)
    	{
    		start = exon_starts[i];
    		end   = exon_ends[i];
    		print(chrom, start, end, name2,sens, name)
    	}
    
    }

And run it : 

      zcat refGene.txt.gz|awk -f to_transcript.awk > exon.bed

3 - Extract sequence using bedtools 

      bedtools getfasta -fi hg19.fa -bed exon.bed -fo exon.fa -name
  
 4 - You may want to reverse sequence for gene placed on the reverse strand. Split exon.bed into  and exon_minus.bed and exon_plus.bed using grep on column 5th. And do same as I described above to have exon_minus.fa and exon_plus.fa
You can then revert your sequence using : 

       seqtk seq -r exon_minus.fasta> exon_minus.rev.fasta 

and concat both file : 

       cat exon_plus.fasta exon_minus.rev.fasta > all_exons.fa


  [1]: http://hgdownload.cse.ucsc.edu/goldenpath/hg19/database/refGene.txt.gz
  [2]: http://hgdownload.cse.ucsc.edu/goldenpath/hg19/bigZips/hg19.2bit
  [3]: http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/twoBitToFa
  [4]: https://github.com/dridk/codon_biais/blob/master/scripts/to_transcript.awk