ExecuteAFile 	(HYPHY_LIB_DIRECTORY+"TemplateBatchFiles"+DIRECTORY_SEPARATOR+"Utility"+DIRECTORY_SEPARATOR+"ReadDelimitedFiles.bf");
fprintf (stdout, "\nComma separated list of accession numbers:");
fscanf	(stdin,"String",accessions);

acList = splitOnRegExp (accessions, "\\,");

allSeqs = "";
allSeqs * 128;

for (aSeq = 0; aSeq < Abs (acList); aSeq = aSeq + 1)
{
	currentAC = acList[aSeq];
	fprintf (stdout, "Working on ", currentAC, "\n");
	theURL = "http://www.ncbi.nlm.nih.gov/nuccore/" + currentAC;
	GetURL  (theData,theURL);
	obtainGI = theData$("gi\\|([0-9]+)\\|gb");
	if (obtainGI[0]>=0)
	{
		obtainGI = theData[obtainGI[2]][obtainGI[3]];
		fprintf (stdout, "=>", obtainGI, "\n");
		
		theURL = "http://www.ncbi.nlm.nih.gov/sviewer/viewer.fcgi?tool=portal&amp;db=nuccore&amp;val="+obtainGI+"&amp;dopt=fasta&amp;sendto=on&amp;log$=seqview";
		GetURL  (theData,theURL);
		allSeqs * (theData + "\n");
		
	}
}

allSeqs * 0;

SetDialogPrompt ("Save FASTA to:");
fprintf (PROMPT_FOR_FILE, CLEAR_FILE, allSeqs);
