View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default reading txt file and copying the lines in new excel file

Hi

Open the txt file in Excel and use this to create seperate sheets
http://www.rondebruin.nl/copy5.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



wrote in message oups.com...
Hello all,

I have a txt file from which I have to make separate excel files
depending upon the code in the starting of the line.

For example: if the txt file looks like:

DFW 10 15 14 67 78
DFW 12 18 00 19 68
DFW 11 33 66 56 79
DFW 12 01 55 34 24
NYK 98 00 34
NYK 58 78 00 15 45
NYK 78 34 46 34 56
CID 12 45 77 19 34

Then, I have to make 3 separate excel files as:

File one should look like:
DFW 10 15 14 67 78
DFW 12 18 00 19 68
DFW 11 33 66 56 79
DFW 12 01 55 34 24

File two should look like:
NYK 98 00 34
NYK 58 78 00 15 45
NYK 78 34 46 34 56

File three should look like:
CID 12 45 77 19 34


any help would be highly appreciated.

Thanks!