combine lines

B

bp

how to combines two lines using perl if the total number of columns to
check is 8. If less than 8, combine with the second line, the OS dumps
it in this format, in reality one line. For example


TEST TEST2 TEST3 TEST4 TEST5
TEST6 TEST7 TEST8


Thanks
 
J

John W. Krahn

bp said:
how to combines two lines using perl if the total number of columns to
check is 8. If less than 8, combine with the second line, the OS dumps
it in this format, in reality one line. For example


TEST TEST2 TEST3 TEST4 TEST5
TEST6 TEST7 TEST8

perl -lape'$_ .= <> if @F < 8' yourfile



John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top