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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write in file (update some lines)

Status
Not open for further replies.

JackTheRussel

Programmer
Joined
Aug 22, 2006
Messages
110
Location
FI
Hi.

I have text-file where I have some data.
Code:
TEXT.TXT
something 3234324
x-range ["95.45.02":"17:85:66"}
y-range [1500:4500]
something 32323223

Every time when I run program the text-file will be update.
(x and y-ranges get new values)

Code:
x-range ["01.04.08":"77:02:03"}
y-range [17800:544500]
something 32323223

So what would be the best solution how to do this ?

Is there some module which would do this or do I have to
go through the file and search line where readsx-range and write new information on the old information?

If so. Could you tell me how to do this ?
 
Tie::File is probably your quickest route to market on this

HTH


Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
using perls inline editor will probably be much fasteer than using tie::file, but I do like tie::file's ease of use. But if the file is really just three lines long just about anyway you do it will be OK.

- Kevin, perl coder unexceptional!
 
never thought for a second it was a three line file :-o

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top