Text file manipulation: selecting specific lines/columns using awk and print
hi,
hopefully someone can help. I have a large number of text files which I need to combine into a single file, but I'm stuck on a simple bit. Each text file is in an identical format. I just need to extract everything in columns 1 and 2 (which I can do) but only lines 164-201 (this is the bit I'm stuck on). I have gotten as far as: cat mytextfile_??.txt | awk '{print $1,$2}' > mynewtextfile.txt Can anyone advise how I specify the range of lines to print from and to? Many thanks, Charlotte |
To clarify:
You want lines 164-201 (inclusive) from each file, and only the contents of columns 1 and 2. Then you want the files combined in sequence? Suppose all the files are in one directory, with nothing else present: Code:
for filename in *; do |
SOLVED: Text file manipulation: selecting specific lines/columns using awk and print
Hi Pixellany
thank you. That seems to work as I wanted. Charlotte NB, I keep trying to thank the people who help me on here using the 'thank icon' but it never seems to work! |
All times are GMT -5. The time now is 04:24 PM. |