I am trying to do some text manipulation mathematicain Mathematica.
After importing a text file (in.txt
) as a string, how would you then output every other line into a new txt?
In the command line using awk
for instance one would do awk 'NR % 9 != 8' in.txt
awk 'NR % 9 != 8' in.txt
However, after looking through the documentation MathematicaMathematica doesn't seem to have any current line number querying mechanism. Do you need to split the input string on every new line and then work with the list of stringstrings? Or is MathematicaMathematica not the best choice for manipulating text?