I put my hands up to being a complete beginner, so apologies if I'm doing this wrong.
Say I have the following data frame that continues indefinitely:
-1 2 3 4 -5 9
2 3 -4 5 -6 11
And I want to only keep the minus signs and every other column, so I get this:
- 2 4 - 9
3 - 5 - 11
And eventually end up with this:
-2 4 -9
3 -5 -11
Is there a way to do this with awk/sed?
This is about a far as I get:
awk '{ for (i=2;i<=NF;i+=2) $i="" }1' FILE.txt | sed 's/[0-9,.]*//g'