For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > August 2006 > simple text file i/o question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author simple text file i/o question
neminem

2006-08-16, 6:27 pm

So I have a large text-file with a bunch of data in it, and I will be wanting to run looped code that will, a bunch of times, go through this file, find the right line and change part of it. I won't know what the right line is at a given iteration until I'm there, so I can't batch-edit the file.

I'm still relatively new at perl, so what I want to know is: is there some easy way to tell perl, look through an input source, don't change anything until you match this regexp, and then rewrite only that line, keeping everything else the same? I'm sure there is, it just isn't coming to me.

Thanks in advance!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com