Batch to change .txt file?

April 23, 2011 at 21:40:38
Specs: Windows XP
I have a .txt file that contains airport names which need to be changed/edited into the individual airports 3-letter code(in parenthesis)....


AMSTERDAM.......needs changed to (AMS)
MINNEAPOLIS MN.......needs changed to (MSP)

My second .txt file contains the names of the airports with it's 3 letter designator next to it(to be used as the source file???)...



Would like to also be able to add/edit airports as needed.

Is this possible with a batch file...or would it require another method?

Thank you.

See More: Batch to change .txt file?

Report •

April 23, 2011 at 22:38:25
The Edit > Replace feature within notepad might be useful. I'm not aware of any sort of batch action that would edit the text inside the txt files for you. With that replace function you can just type in things and hit replace all if there is more than once instance however.

Report •

April 24, 2011 at 00:33:47
What else is in the first file?

Life is too important to be taken seriously.


Report •

April 24, 2011 at 08:56:51
Thanks for the replies.

The first .txt contains other information from a typical airline timetable, such as flight times, flight numbers, valid date periods for flight segments, etc. As an example from the KLM timetable...

1 2 3 4 5 6 7 0625 0750 KL1332 KLc 1:25 0
1 2 3 4 5 6 7 1415 1540 KL1336 KLc 1:25 0

1 2 3 4 5 6 7 1306 1420 KL8715 XJ 1:14 0
- 2 - - - - - 1306 1424 KL5529 XJ 1:18 0

In this example KLM does provide the 3 letter identifier for the airport of departure[(AAL),(ABR)] but shows only the full name of the arrival airports(AMSTERDAM,MINNEAPOLIS MN) while omitting the 3 letter identifier.

It's true that I can manually Edit/Replace these on the text file...unfortunately there may be a hundred or so different airports on the 1st .txt file that require the change....I'm just looking for a shortcut for this part of the process.

Report •

Related Solutions

Ask Question