Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find strings in a file and write to the same file

Status
Not open for further replies.

sappleg

Programmer
Apr 15, 2008
31
CA
Hi Guys,

I have a question. Hope you could help. I currently have a txt file, containing three lines of text, e.g.

Line_1. ABC
Line_2. DEF
Line_3. GHI

I want to open this file, search for these three lines in the file and have a new line added to the bottom of the same file as:

Line_sum. ABC, DEF, GHI.

Please note that I am opening and writing to the same file that I am using to search the three strings.

Any help is appreciated.
Thanks a lot.
 
what have you tried so far?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top