[buug] data manipulation problem - UNIX sed/awk/perl solution ???

Michael Salmon ms at formulae.org
Fri Aug 9 13:19:14 PDT 2002


On Fri, Aug 09, 2002 at 03:29:12PM -0400, Gorden-Ozgul, Patricia E wrote:
> Michael,
> 
> I appreciate your response.  I couldn't get your suggestions to work.  Each
> tme vi returns 'Not an editor command'.  It's okay, though.  I'll work
> around it.

Oh, you aren't using vim. vim is basically a seriously improved vi
that most people use. www.vim.org. I generally assume people use vim
nowadays and not the classic vi. 
 
> Why in heaven's name would you want to work here at Brookhaven?  I guess
> I've just been here too long.

No reason other then it would sound good on a resume, "Computer Scientist 
at National Laboratory".

> Pat
> 
> -----Original Message-----
> From: Michael Salmon [mailto:ms at formulae.org]
> Sent: Wednesday, August 07, 2002 3:09 PM
> To: Gorden-Ozgul, Patricia E
> Cc: buug at weak.org
> Subject: Re: [buug] data manipulation problem - UNIX sed/awk/perl
> solution???
> 
> 
> On Wed, Aug 07, 2002 at 01:57:21PM -0400, Gorden-Ozgul, Patricia E wrote:
> > I'm a 'database' person who enters the wonderful word of UNIX only
> > occasionally.
> > It usually provides a solution to any problem if one knows how to use it.
> > 
> > I'm in the process of converting data from one system to another.
> > I have a datafile that requires manipulation.
> > When observing the data in vi, while in :set list mode, each line ends
> with
> > '$'
> > 
> > My problem?
> > The source system truncated some lines of data, placing the '$'
> prematurely
> > to and began a new line.  For example:
> > 
> > ...
> > ...
> > <#NAME = PUBLISHER>Random House</#NAME>
> > <#NAME = AUTHOR>Smith, James; Smith, Peter; Smith, Johanna; Smith,
> Roberta;
> > Smith, Robert; Smith, Douglas; Smith, Katherine; Smith, Denis; Smith,
> > Mustafa$
> > Smith, Karen; Smith, Alexander; Smith, Alexandra$
> > <#NAME = TITLE>This is the Title</#NAME>$
> > ...
> > ...
> > 
> > What do I want?
> > 
> > ...
> > ...
> > <#NAME = PUBLISHER>Random House</#NAME>
> > <#NAME = AUTHOR>Smith, James; Smith, Peter; Smith, Johanna; Smith,
> Roberta;
> > Smith, Robert; Smith, Douglas; Smith, Katherine; Smith, Denis; Smith,
> > Mustafa; Smith, Karen; Smith, Alexander; Smith, Alexandra$
> > <#NAME = TITLE>This is the Title</#NAME>$
> 
> > Would anyone out there have code that would perform this task?
> 
> in vim do.
> :g /^\([^<]\)/-1j
> or
> :g /^[^<]/normal kJ\1x
> 
> now how about getting me a job at that big fancy laboratory? :)
> 
> > 
> > Please respond to gorden at bnl.gov.
> > 
> > Pat Gorden-Ozgul
> > _______________________________________________
> > Buug mailing list
> > Buug at weak.org
> > http://www.weak.org/mailman/listinfo/buug



More information about the buug mailing list