I have several text files of varying formats.
Sample data from text file:
NAME: JOHNSON DATE: 6-29-98 NUMBER: 1120
ADDRESS: 123 WISNER ST CITY: SCRANTON
PHONE: 555-1212 ACCOUNT #: NEW ACCOUNT
METER #: NA DATE OF INSTALLATION: 6-29-98
COMPLETE YES: Y NO:
COMMENT: FLAT RATE-(103)
I would like something that will run through the text file and output something like this for each instance of city it finds:
Basically the regular expression needs to find instances of "CITY: CITY NAME " CR/LF
I'm not sure how to do this. If there is an online resource or page that has this where I can copy and paste data from the files and get the output like I am looking for that could work or I am open to using PHP to do it as well.
I'm looking for Quick and Easy.