Dec 9, 2011, 8:25 AM
Post #1 of 2
Storing a variable amount of text?
I'm trying to store some text into a variable...
The text is in between double quotes but the length is variable. Also I need to ignore a line if it contains a certain value in those double quotes, such as "CODE". The remaining line's text needs to be stored in a different variable.
so here would be the example file:
Previously the fields were fixed 16 characters so I did this:
my $1stfield = substr($line,0,16);
my $remaining = substr($line,16);
Could someone please help me solve this? Many thanks for your time.