drock has asked for the wisdom of the Perl Monks concerning the following question:
The substr is sort of what I want, but is sprintf possible ...what should I use? Here is what my end results will look like if I had a file with 40 E strings: Exxxx Exxxx Exxxx Exxxx Exxxx Exxxx Exxxx Exxxx \n x5 \n anything less but it cannot exceed 8 per line: Exxxx Exxxx Exxxx Exxxx Exxxx Exxxx Exxxx Exxxx \n Exxxx ..... \n thank you,print FILEOUT "eject 0,0,0 "; my $count = `wc -l <$ejectapes`; if ($count <= 40 ) { while(<FILE>) { chomp $_; print FILEOUT "$_ "; # if 1..8 #print substr($a,0,7); } close (FILEOUT); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: printing certain number of data
by Fletch (Bishop) on Jul 01, 2004 at 16:07 UTC | |
by drock (Beadle) on Jul 01, 2004 at 16:49 UTC | |
by Fletch (Bishop) on Jul 01, 2004 at 18:27 UTC | |
by Not_a_Number (Prior) on Jul 01, 2004 at 17:28 UTC | |
|
Re: printing certain number of data
by TrekNoid (Pilgrim) on Jul 01, 2004 at 17:39 UTC | |
|
Re: printing certain number of data
by tachyon (Chancellor) on Jul 02, 2004 at 00:34 UTC |