#!/prod/bin/perl use strict; use warnings; use Data::Dumper; undef $/; my @data; my $counter = 0; while (my $line = <DATA>) { @data = split (/\t/, $line); print Dumper \@data; $counter = $counter+1; print "$counter, $data[11], $data[12]\n"; } __DATA__ LIMITS LIMITS1 LIMITS2 LIMITS3 LIMITS4 LIMITS5 LIMIT +S6 LIMITS7 UPDATEDATE STEP2 DESC2 APPR2 APPRID2 +OWNR2 OWNRID2 Limits less than $1K $1K-50K $50k-$250K more than $250K + $250K-$1M $1M-$5M more than $5M 8/16/2006 2:14:00.000 PM + 111111 Cost Center 1 Stien, Franklin N 000204 Stien, Fra +nklin N 000204 Limits less than $1K $1K-50K $50k-$250K more than $250K + $250K-$1M $1M-$5M more than $5M 8/16/2006 2:14:00.000 PM + 222222 Cost Center 2 Bear, Izzy 000598 Bear, Izzy 000 +598 Limits less than $1K $1K-50K $50k-$250K more than $250K + $250K-$1M $1M-$5M more than $5M 8/16/2006 2:14:00.000 PM + 333333 Cost Center 3 Bear, Fozzy 000485 Davis, Sammy +000404 Limits less than $1K $1K-50K $50k-$250K more than $250K + $250K-$1M $1M-$5M more than $5M 8/16/2006 2:14:00.000 PM + 444444 Cost Center 4 Frog, Kermit T 000990 Frog, Kermit +T 000990 Limits less than $1K $1K-50K $50k-$250K more than $250K + $250K-$1M $1M-$5M more than $5M 8/16/2006 2:14:00.000 PM + 555555 Cost Center 5 Cleavland, Grover 000563 Cleavland, + Grover 000563
In reply to Why is file being slurped in instead of line by line? by Grey Fox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |