Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Merging two files and changing format

by BrowserUk (Pope)
on Oct 11, 2012 at 15:53 UTC ( #998485=note: print w/replies, xml ) Need Help??


in reply to Merging two files and changing format

C:\test>head -3 1.dat 01 01 01 01 01 01 02 02 02 02 02 02 03 03 03 03 03 03 C:\test>head -3 2.dat A A A B B B C C C C:\test>perl -nle"printf "%s",join qq[\t],split(' ',$_),do{(my$t=<STDI +N>)=~tr/ //d;split'',$t};" <1.dat 2.dat A A A 0 1 0 1 0 1 + 0 1 0 1 0 1 B B B 0 2 0 2 0 2 + 0 2 0 2 0 2 C C C 0 3 0 3 0 3 + 0 3 0 3 0 3 D D D 0 4 0 4 0 4 + 0 4 0 4 0 4 ...

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998485]
help
Chatterbox?
[ambrus]: Corion: schmorp points out https://metacpan. org/pod/release/ KARASIK/Prima-1. 49/pod/Prima/File. pod,
[ambrus]: so there's an IO waiter (Prima::File) and a timer (Prima::Timer) maybe it's possible to write an AnyEvent loop driver over it, a saner one than POE

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (15)
As of 2016-12-07 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (130 votes). Check out past polls.