in reply to telling script to read from next line
You will need to rewrite your data file to get records separated by newlines. As an alternative, you can redefine perl's idea of an input record.
You can set the input record separator, $/ to your file's delimiter, here ';'. local should be used since $/ is a global.
{ local $/ = ';'; # input record separator - this is what chomp eats local $\ = "\n"; open(FILE, $adfile) || die "Can't open $adfile", $!; open(NEWFILE, "> $adfile.new") || die "Can't open new $adfile", $! +; while (<FILE>) { chomp; print NEWFILE; } close(NEWFILE>; close(FILE); }
The example here writes you a new data file with newlines.
After Compline,
Zaxo
Update: repaired loss of last record if ';' not present
|
|---|