in reply to Converting data from file with multiline records
____________#!/usr/bin/perl -w use strict; my $fields_per_record = 4; while(<>) { chomp; my @records = split " ", $_; if(@records < $fields_per_record) { last if not defined (my $next = <>); $_ .= $next; redo; } print "@records\n"; }
|
|---|