I have a file with 3 columns
2 4 5
2 4 7
3 5 7
4 -6 9
5 -9 4
6 -3 3
Bascially I want to delete the entire row if column 2 is a "-"
So the end result will be
2 4 5
2 4 7
3 5 7
I have trouble doing this cause of the - in front of the number.
thanks
Kyle
gxmsgx
2
# cat file.txt
2 4 5
2 4 7
3 5 7
4 -6 9
5 -9 4
6 -3 3
2 4 6
-2 4 6
2 4 -6
to delete ONLY the lines with "-x" in the second column
# sed '/.-../d' file.txt
2 4 5
2 4 7
3 5 7
2 4 6
-2 4 6
2 4 -6
...otherwise just so:
# grep -v - file.txt
2 4 5
2 4 7
3 5 7
2 4 6
an awk can do..
awk '$2 !~ /-/ {print}' filename