Extract every nth character from a txt file
Thanks in advance for looking.
So I have a txt file where I need to extract every third character and
print it to separate file using Terminal. The txt file is just a long list
of numbers, tab delimited:
18 25 0 18 24 5 18 23 5 18 22 8.2 ...
I know there is a way to do this using sed or awk, but so far I've only
been able to extract every third LINE:
awk 'NR%3==1' testRain.txt > rainOnly.txt
I'm sure the solution is very simple; forgive my ignorance!
Thanks,
john
No comments:
Post a Comment