niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » Perl
combine lines
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
bp
*nix forums beginner


Joined: 26 Apr 2005
Posts: 2

PostPosted: Tue Jul 18, 2006 11:48 pm    Post subject: combine lines Reply with 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


Thanks
Back to top
John W. Krahn
*nix forums Guru


Joined: 27 Feb 2005
Posts: 602

PostPosted: Wed Jul 19, 2006 12:17 am    Post subject: Re: combine lines Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 7:33 am | All times are GMT
navigation Forum index » Programming » Perl
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts blocking mails with long lines and giberish Dale Blount Postfix 4 Thu Jul 20, 2006 2:31 pm
No new posts Match lines, group and sum FriesAOLE shell 2 Thu Jul 20, 2006 7:40 am
No new posts Reading long lines doesn't work in Python Scott Simpson python 2 Wed Jul 19, 2006 4:25 pm
No new posts Is it possible to combine mysql with nis? Cheng-Lin Yang MySQL 2 Wed Jul 19, 2006 11:50 am
No new posts joining lines in ksh jctown@nb.sympatico.ca shell 13 Wed Jul 19, 2006 1:28 am

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
[ Time: 0.1397s ][ Queries: 16 (0.0707s) ][ GZIP on - Debug on ]