On Sat, Mar 11, 2000 at 09:23:46PM -0500, [EMAIL PROTECTED] wrote:
>
> BEGIN{FS=OFS="\t";}{if ($1 == "0"||$1 == "-1"){print\
> $6,$1,$2,$3,$4,$5;}else{print;}}
>
> Lawson
>
I think I got it. If you make shift.awk look like so,it'll double
print:
FS=OFS="\t";{if ($1 == "0"||$1 == "-1"){print\
$6,$1,$2,$3,$4,$5;}else{print;}}
without the BEGIN{} block, every time through, awk sets FS&OFS,
then notices that there is a statement that evaluates to non-zero
("\t"), so prints the line.
Robert:
I've found the GNU awk manual helpful before, you might take a look:
http://www.gnu.org/manual/gawk-3.0.3/html_mono/gawk.html
and if you can't make your program stop double printing, you could
pipe it through
awk 'NR % 2'
or
awk '!(NR % 2)'
whichever is appropriate.
have funk
greg
--
dronf!
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs