but it would be nice to know the syntax to print a range cols.
I know in cut you can do,
cut -f 1,4-8,11-
to print fields 1, 4,5,6,7,8, and from 11 to the end of the line, but I don't know if cut has a variable for the last col like $NF.
Since I am moving $NF from the end, it shouldn't be printed again, but that complexifys things a bit more. If it was printed again, it would be easy enough to get rid of it in a second step, but it seems as if there should be a straightforward way to do this in one step.
Well that explains why sed was replacing all instances, since there was only one per line.
I am having trouble with some nested conditionals.
# if compounds were found for the class
if [ $MOLFILECOUNT -gt 0 ]
then
# sort list of class structures
data_sort_rows_headerName.sh $SETS'_sort_'*'.txt' \
PASS1.txt \
SORT1.txt \
'_makesdf_'$SETS'_'$MOLFILECOUNT'_'$DATASOURCE'_'$DATE_CODE'.txt'
# if the output file does not exist, use SORT1 to start the file
if[ ! -f "$OUTPUFILE" ]
then
cp SORT1.txt TEMPOUTPUT1
else
cat TEMPOUTPUT1 SORT1.txt > TEMPOUTPUT2
fi
fi
This code is throwing an exception,
line 111: syntax error near unexpected token `then'
line 111: ` then'
I have highlighted the then that the error is referring to. I know I have used syntax like this before, so I'm not sure what the issue could be.