search for: oddlines

Displaying 1 result from an estimated 1 matches for "oddlines".

Did you mean: addlines
2007 Apr 30
3
Read every second line from ASCII file
Dear all, I have an ASCII file where records are separated by a blank. I would like to read those data; however, only the data in rows 1, 3, 5, 7, ... are important; the other lines (2,4,6,8,....) contain no useful information for me. So far I used awk/gawk to do it: gawk '{if ((FNR % 2) != 0) {print $0}}' infile.txt > outfile.txt What is the recommended way to accomplish this in R?