View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Diana Diana is offline
external usenet poster
 
Posts: 61
Default open text file, get file from directory, update file

I have a text file. Lots of rows. The second field is a date yymmdd. It looks
like:

ABC, 091012, 1.47, 1.51, 1.46, 1.495, 586907
XYZ, 091012, ....
etc...

I want to take the value in the first field, in this case "ABC", open a file
called ABC_XXX.csv. I don't care what XXX is, as long as the ABC part matches.

Format of the csv file is:
ABC, 10-Aug-99, 0.9734, 0.9567, etc.
ABC, 11-Aug-99, etc..
etc...

I want to append the row from the text file to the .csv file.

So that the ABC_XXX.csv file has the row:

ABC, 12-Oct-09, 1.47, 1.51, 1.46, 1.495, 586907

added. Date reformatted from 091012 to dd-mmm-yy.