bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

GREP -v in a loop


From: Andrew Barton
Subject: GREP -v in a loop
Date: Tue, 14 Jan 2003 16:56:53 -0500

Hello,

I am attempting to use the grep command to edit unwanted information out
of numerous, long ascii files.  Directly from the command line, the
command:

grep -v Time 'filename.ascii' | grep -v DATE | grep -v Location | grep
-v Units | grep -v Depth > 'outfile.ascii'

functions perfectly well, eliminating all lines of ASCII text beginning
with the words Time, DATE, Location, Units, and Depth.  However, when
incorporated into a loop shown below:

#!/bin/bash

files=~/buoys/test/*.ascii

for i in $files 
do
        outname=$i
        grep -v Time $i | grep -v DATE | grep -v Location | grep -v Units |
grep -v Depth > $outname
done

the output ascii files are cut off at exactly 726 lines.  The ASCII
files are 7 columns.  

I have tried increasing NUM, count, and other grep commands.  None have
allowed the entire ASCII file to be read.  I imagine that this is a
memory problem.  How can I circumvent such a grep limitation?

Thank you for your help,

Andrew Barton
NOAA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]