|
|
|
|
|
|
| Author |
Message |
bp *nix forums beginner
Joined: 26 Apr 2005
Posts: 2
|
Posted: Tue Jul 18, 2006 11:48 pm Post subject:
combine lines
|
|
|
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 |
|
| Back to top |
|
 |
John W. Krahn *nix forums Guru
Joined: 27 Feb 2005
Posts: 602
|
Posted: Wed Jul 19, 2006 12:17 am Post subject:
Re: combine lines
|
|
|
bp wrote:
| Quote: | 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
--
use Perl;
program
fulfillment |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Thu Jan 08, 2009 7:33 am | All times are GMT
|
|
Bankruptcy | Remortgages | Debt Consolidation | Secured Loans | Loans
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|