On Thu, Jun 03, 2010 at 11:53:43AM -0700, Scotty Logan wrote:
> On Jun 2, 2010, at 7:23 PM, Eben King wrote:
> > I'm pretty good at regexes, but programming in sed is where I break
> down. How does one convert this:
> >
> > A1
> > B1
> > A2
> > B2
> > A3
> > B3
> > ...
> >
> > into this:
> >
> > A1 B1
> > A2 B2
> > A3 B3
> > ...
>
>
> Assuming the data's exactly like the example:
>
> % awk '/^A/{s=$1;}/^B/{print s,$1}' data-file
I was wondering how long it would be before someone brought up awk.
Paul
-- Paul M. Foster ----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.
This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:46:00 EDT