Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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


Comment on Re: Merging two files and changing format
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-08-23 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (176 votes), past polls