Re: [opensuse] Another grep question



On Sunday 08 April 2007 20:49:02 James Hatridge wrote:
Hi all,,

I'm not sure if this is a grep or awk question. I have a file with many
records of 4 lines each in it. Like this:

1
2
3
4
1
2
3
4
etc, etc

I need the file to look like this:

1 tab 2 tab 3 tab 4
1 tab 2 tab 3 tab 4
etc etc....

How can I do this?

Perhaps with bash?

#!/bin/bash

while read line1; do
read line2;
read line3;
read line4;
echo -e "$line1\t$line2\t$line3\t$line4" >> outputfile
done < testfile

--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx



Relevant Pages

  • Re: [opensuse] grep question
    ... On Friday 30 March 2007 15:47, James Hatridge wrote: ... I have files with mailing addresses in them. ... Can I use grep to pull all the address ... For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx ...
    (SuSE)
  • Re: [opensuse] grep question
    ... On Friday 30 March 2007 06:47, James Hatridge wrote: ... I have files with mailing addresses in them. ... Can I use grep to pull ... Randall Schulz ...
    (SuSE)
  • Re: [opensuse] grep question
    ... On 3/30/07, James Hatridge wrote: ... I have files with mailing addresses in them. ... Can I use grep to pull all the address out? ... I would attack it with awk. ...
    (SuSE)
  • Re: [SLE] grep question ...
    ... On Wednesday 27 April 2005 16:46, James Hatridge wrote: ... Quoting from 'man grep', in which I searched for "count": ... Please read the FAQs: suse-linux-e-faq@suse.com ...
    (SuSE)