Long time parishioner, finally have a problem that my skills don't have, and a search did not provide a solution... You guys are great... Thanks for the anonymous help.
Have a great many text files... All of which have the pesky ^M for EOL, nothing I can do about that (files are created by an outside program).
I need to search each file, find a match, and replace a word that is two lines below.
Example of text:
__TypeOfAirframe__2_0_Cessna152^M
__StartAltitude__2_0_1200^M
__GearStatus__2_0_Down^M
I want to toggle the gear on all Cessna152s.
For clarity... I used _ as space markers. Imagine the above block is repeated 30 or more times, in hundreds of files. TypeOfAirframe is not always a Cessna, so I don't want to toggle the gear on my 747.
I have had great luck with
perl -pi -e 's/find/replace/g' *.txtBut, I cannot get it to recognize the ^M and spaces to perform a search on the above phrase. HELP?
In reply to Find Replace by SimTech
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |