Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: split a line by control ^D character

by karlgoethebier (Curate)
on Dec 02, 2012 at 18:37 UTC ( #1006743=note: print w/ replies, xml ) Need Help??


in reply to split a line by control ^D character

TIMTOWTDI

#!/usr/bin/perl + use strict; use warnings; use IO::All; my $io = io( shift ) || die $!; for ( $io->getlines ) { print join( qq(|), split /\x04/ ); } __END__ Karls-Mac-mini:monks karl$ perl -e 'for( 1..3 ){ print qq(foo\x04bar\x +04baz\n) };' > records.dat Karls-Mac-mini:monks karl$ cat records.dat foobarbaz foobarbaz foobarbaz Karls-Mac-mini:monks karl$ ./eot.pl records.dat + foo|bar|baz + foo|bar|baz + foo|bar|baz + + +

See IO::All

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»


Comment on Re: split a line by control ^D character
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1006743]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-08-30 01:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (291 votes), past polls