add columns from outside string into text file
hi guys.
I'm new in VB and I have some text file (F:\path\Boeing747\Lufthansa.txt) consist of data as below:
2013-03-01 00:05:01|Florence
2013-03-01 00:20:01|Tokyo
2013-03-01 00:35:01|Oslo
2013-03-01 00:40:01|Los Angeles
is there any code that I can use to add more columns so that the data would be looked like below:
2013-03-01 00:05:01|Lufthansa|Boeing747|Florence
2013-03-01 00:20:01|Lufthansa|Boeing747|Tokyo
2013-03-01 00:35:01|Lufthansa|Boeing747|Oslo
2013-03-01 00:40:01|Lufthansa|Boeing747|Los Angeles
kindly need your advice.
thank's
Re: add columns from outside string into text file
You would need to read the file into your program, probably one line at a time using the Line Input # method then make changes to the data from that line and then write it out to a new file using the Print # method. You would do this in a loop to process every line then once you are done close the files and if desired use Kill to delete the original file and Name to rename the new file.