Extracting Text from txt file
Posted: Fri Oct 19, 2007 9:50 am
I am trying to rename a file by using data from a text file's first few lines. It is consistent text file and need to extract bolded text to rename the new file. Following is the initial lines of the text file (text itself is modified, format is same):
----------------------------------
Lutheran Hospital of USA LASTNAME, FIRSTNAME MIDDLE
12345 Washington Blvd. A0000123456
TownName, State 12345 DOB: 01/01/2004
ROOM NUMBER: 123
John Smith, MD
Date of Admission: 09/10/2007
HISTORY AND PHYSICAL
-------------------------------------
My existing file name is just serial number, total 8 character long with .txt extension (00000012.txt)
I like to rename using above bold items following way.
LHN LASTNAME FIRST NAME 01-01-2004 H&P 09-10-2007.TXT
Any help is appreciated.
Thank you.
Jay.
----------------------------------
Lutheran Hospital of USA LASTNAME, FIRSTNAME MIDDLE
12345 Washington Blvd. A0000123456
TownName, State 12345 DOB: 01/01/2004
ROOM NUMBER: 123
John Smith, MD
Date of Admission: 09/10/2007
HISTORY AND PHYSICAL
-------------------------------------
My existing file name is just serial number, total 8 character long with .txt extension (00000012.txt)
I like to rename using above bold items following way.
LHN LASTNAME FIRST NAME 01-01-2004 H&P 09-10-2007.TXT
Any help is appreciated.
Thank you.
Jay.