I have a list of files in the same parent directory all of which have a .new
extension (for example 1001O5V.new
).
All of these files have two columns (column 1 wavelength, column 2 flux).
I need to make a loop into each file and extract only those values which have $1 > 3599.99 && $1 < 7400.01
I'm currently trying this:
for f in *.new; do
awk '{if ($1 > 3599.99 && $1 < 7400.01) print $1,$2}' ${f} > ${f}
done
But the files are replaced with blank files! What am I doing wrong?