Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: split a line by control ^D character

by karlgoethebier (Parson)
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


#!/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$ ./ 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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2015-11-25 16:25 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (682 votes), past polls