Gossamer Forum
Home : General : Perl Programming :

Setting specific line in file as variable

Quote Reply
Setting specific line in file as variable
So I have this file, lets call it data.txt. It has multiple lines of text.

I want the script to find a line beginning with the variable $goto (previously defined in the script, 6 characters in length), and set the ENTIRE line as the variable $line . Each line in data.txt will begin with 6 unique characters.



Thanks,

Peter
Subject Author Views Date
Thread Setting specific line in file as variable petermcdonald 6306 Sep 1, 2002, 4:21 PM
Thread Re: [petermcdonald] Setting specific line in file as variable
durp 6177 Sep 1, 2002, 10:08 PM
Thread Re: [durp] Setting specific line in file as variable
petermcdonald 6185 Sep 1, 2002, 10:50 PM
Thread Re: [petermcdonald] Setting specific line in file as variable
petermcdonald 6177 Sep 1, 2002, 11:06 PM
Thread Re: [petermcdonald] Setting specific line in file as variable
Paul 6161 Sep 2, 2002, 2:10 AM
Post Re: [Paul] Setting specific line in file as variable
durp 6156 Sep 2, 2002, 10:31 AM
Thread Re: [Paul] Setting specific line in file as variable
petermcdonald 6146 Sep 2, 2002, 10:34 AM
Thread Re: [petermcdonald] Setting specific line in file as variable
petermcdonald 6169 Sep 2, 2002, 10:37 AM
Post Re: [petermcdonald] Setting specific line in file as variable
Paul 6162 Sep 2, 2002, 10:50 AM
Thread Re: [petermcdonald] Setting specific line in file as variable
Paul 6122 Sep 2, 2002, 10:56 AM
Thread Re: [Paul] Setting specific line in file as variable
petermcdonald 6140 Sep 2, 2002, 11:07 AM
Thread Re: [petermcdonald] Setting specific line in file as variable
Paul 6139 Sep 2, 2002, 11:34 AM
Thread Re: [Paul] Setting specific line in file as variable
petermcdonald 6152 Sep 2, 2002, 11:55 AM
Thread Re: [petermcdonald] Setting specific line in file as variable
Paul 6145 Sep 5, 2002, 4:21 AM
Post Re: [Paul] Setting specific line in file as variable
petermcdonald 6104 Sep 7, 2002, 6:07 PM