Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: split a line by control ^D character

by karlgoethebier (Vicar)
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 perusing the Monastery: (7)
As of 2015-07-30 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls