Re: Editing a text file with sed

2007-08-31 Thread Joe Hart
On Wednesday 29 August 2007 17:26:25 Mumia W.. wrote: > On 08/29/2007 08:17 AM, Joe Hart wrote: > > I am having trouble using sed to edit text files, heres a good example of > > what I am looking for: > > > > > > This is a test > > file, what I am > > trying to do is get the lines to join. > > > >

Re: Editing a text file with sed

2007-08-31 Thread Hugo Vanwoerkom
Joe Hart wrote: On Wednesday 29 August 2007 17:01:20 Adam W wrote: Single quotes go around the whole sed script unless you are using a separate sed script file. try sed 's/\n//' 1.txt > 2.txt - Adam On 8/29/07, Florian Kulzer <[EMAIL PROTECTED]> wrote: On Wed, Aug 29, 2007 at 15:17:46 +

Re: Editing a text file with sed

2007-08-30 Thread Keith Christian
Joe, you could also try the 'par' program, see: http://packages.debian.org/cgi-bin/search_packages.pl?searchon=names&version=all&exact=1&keywords=par It has a lot of options and can handle more complex documents than fmt can. Keith -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a

Re: Editing a text file with sed

2007-08-30 Thread Johannes Wiedersich
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Joe Hart wrote: [snip] > I appreciate the answer, I didn't even know about the fmt command until now. > It does seem to work in the example, but not on the real file(s) that I am > working with. Something makes me think that these files have some

Re: Editing a text file with sed

2007-08-29 Thread Richard Lyons
On Wed, Aug 29, 2007 at 06:33:54PM +0200, Joe Hart wrote: > On Wednesday 29 August 2007 17:36:38 Kumar Appaiah wrote: > > On Wed, Aug 29, 2007 at 03:17:46PM +0200, Joe Hart wrote: > > > > > > This is a test > > > file, what I am > > > trying to do is get the lines to join. > > > > > > It isn't a

Re: Editing a text file with sed

2007-08-29 Thread Kumar Appaiah
On Wed, Aug 29, 2007 at 06:33:54PM +0200, Joe Hart wrote: > I appreciate the answer, I didn't even know about the fmt command until now. > It does seem to work in the example, but not on the real file(s) that I am > working with. Something makes me think that these files have some very > stran

Re: Editing a text file with sed

2007-08-29 Thread Mumia W..
On 08/29/2007 08:17 AM, Joe Hart wrote: I am having trouble using sed to edit text files, heres a good example of what I am looking for: This is a test file, what I am trying to do is get the lines to join. It isn't a complicated thing, but I also want to keep the paragraphs separate. I try

Re: Editing a text file with sed

2007-08-29 Thread Joe Hart
On Wednesday 29 August 2007 17:01:20 Adam W wrote: > Single quotes go around the whole sed script unless you are using a > separate sed script file. > try sed 's/\n//' 1.txt > 2.txt > > - Adam > > On 8/29/07, Florian Kulzer <[EMAIL PROTECTED]> wrote: > > On Wed, Aug 29, 2007 at 15:17:46 +0200

Re: Editing a text file with sed

2007-08-29 Thread Joe Hart
On Wednesday 29 August 2007 17:36:38 Kumar Appaiah wrote: > On Wed, Aug 29, 2007 at 03:17:46PM +0200, Joe Hart wrote: > > > > This is a test > > file, what I am > > trying to do is get the lines to join. > > > > It isn't a complicated thing, > > but I also want to keep the paragraphs > > separate.

Re: Editing a text file with sed

2007-08-29 Thread Kumar Appaiah
On Wed, Aug 29, 2007 at 03:17:46PM +0200, Joe Hart wrote: > > This is a test > file, what I am > trying to do is get the lines to join. > > It isn't a complicated thing, > but I also want to keep the paragraphs > separate. > [snip] > But ideally I'd like to just have a script to do it, but canno

Re: Editing a text file with sed

2007-08-29 Thread Sjoerd Hardeman
This command erases all line breaks sed -e :a -e '$!N;s/\n/ /;ta' -e 'P;D' although you have to adapt it to not delete paragraphs. Using regex, the line would then become something like sed -e :a -e '$!N;s/\n[^\n]/ /;ta' -e 'P;D' Good luck. Sjoerd Joe Hart schreef: > I am having trouble using sed

Re: Editing a text file with sed

2007-08-29 Thread Adam W
Single quotes go around the whole sed script unless you are using a separate sed script file. try sed 's/\n//' 1.txt > 2.txt - Adam On 8/29/07, Florian Kulzer <[EMAIL PROTECTED]> wrote: > On Wed, Aug 29, 2007 at 15:17:46 +0200, Joe Hart wrote: > > > > I am having trouble using sed to edit t

Re: Editing a text file with sed

2007-08-29 Thread Florian Kulzer
On Wed, Aug 29, 2007 at 15:17:46 +0200, Joe Hart wrote: > > I am having trouble using sed to edit text files, heres a good example of > what > I am looking for: > > > This is a test > file, what I am > trying to do is get the lines to join. > > It isn't a complicated thing, > but I also want

Re: Editing a text file with sed

2007-08-29 Thread Joe Hart
On Wednesday 29 August 2007 15:48:50 Victor Munoz wrote: > On Wed, Aug 29, 2007 at 03:17:46PM +0200, Joe Hart wrote: > > I am having trouble using sed to edit text files, heres a good example of > > what I am looking for: > > > > > > This is a test > > file, what I am > > trying to do is get the l

Re: Editing a text file with sed

2007-08-29 Thread Victor Munoz
On Wed, Aug 29, 2007 at 03:17:46PM +0200, Joe Hart wrote: > > I am having trouble using sed to edit text files, heres a good example of > what > I am looking for: > > > This is a test > file, what I am > trying to do is get the lines to join. > > It isn't a complicated thing, > but I also wan

Editing a text file with sed

2007-08-29 Thread Joe Hart
I am having trouble using sed to edit text files, heres a good example of what I am looking for: This is a test file, what I am trying to do is get the lines to join. It isn't a complicated thing, but I also want to keep the paragraphs separate. I try this command: sed s/\n// / 1.txt > 2.tx