Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] sed or perl script help please . . .
- Date: Tue, 6 Aug 2002 00:26:13 +0900 (JST)
- From: SAKUMA Junichi <jun@example.com>
- Subject: Re: [tlug] sed or perl script help please . . .
- References: <F132q9IcVux1Zcn8TtE000005b5@example.com>
- Organization: Open Source Development Lab
Assuming your text includes no errors, #!/usr/bin/perl while(<>) { s/\n/ /; $line .= "\n" if (split)[0] > 1; $line .= $_; } print "$line\n"; This worked at least with your example. HTH. On Mon, 05 Aug 2002 19:34:27 +0900 "Jean-Christian Imbeault" <jean_christian@example.com> wrote: > I have a large text file that unfortunately got line-wrapped or something in > the transfer and I would like to "undo" the line wrapping .. > > Luckily each line was numbered in the original file so it should make my > task easier but > I've been trying for the last hour to come up with a sed script to concat > the lines together but can't seem to get it quite right. > > I have a file that contains lines like this: > > 1 some > text with > C/R's > in annoying places > 2 more text > with CRs > 3 text text text > 4 text text > > I'd like to concat the lines that don't have leading numbers in to one long > line like this: > > > 1 sometext with C/R's in annoying places > 2 more text with CRs > 3 text text text > 4 text text > > Can someone suggest a sed (or perl if it is better suited to this) script to > concat the lines? > > Thanks! > > Jc > > _________________________________________________________________ > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > ************************************************* > TLUG server is hosted by Global Online Japan > http://home.gol.com/index_e.html > ************************************************* > > ================================================= > To unsubscribe from this mailing list, > please see instructions at > http://www.tlug.jp/list.html > ================================================= -- SAKUMA Junichi <jun@example.com> Key fingerprint = 199D 03E9 E7C0 CC66 E2D9 AD3F CB2E F76F 8AD9 FC62
- References:
- [tlug] sed or perl script help please . . .
- From: Jean-Christian Imbeault
Home | Main Index | Thread Index
- Prev by Date: [tlug] Tokyo internships?
- Next by Date: [tlug] searching but don't where to look!!
- Previous by thread: Re: [tlug] sed or perl script help please . . .
- Next by thread: Re: [tlug] sed or perl script help please . . .
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links