Search Results

Search: Posts Made By: catwoman
3,926
Posted By catwoman
Thanks for that it's worked a treat!! Just one...
Thanks for that it's worked a treat!! Just one question... does:

nr=NR%40

just dictate that the first set of 40 lines should be processed first, and subsequent sets after?
3,926
Posted By catwoman
Do you mean by echo-ing/printing the selected...
Do you mean by echo-ing/printing the selected line range, feeding that into the above program and then appending the output to another file?

Cheers :)
3,926
Posted By catwoman
Arrays in awk
Hi, I've written the following code to manipulate the first 40 lines of a data file into my desired order:

#!/bin/awk -f
{ if (NR<=(4)){
a[NR]=a[NR]$0" "}
else { if ((NR >= (5)) && (NR <=...
9,908
Posted By catwoman
Ok that's brilliant thanks. But what if the...
Ok that's brilliant thanks.

But what if the initial wavelengths sometimes varied, so you might get:

4862 x(1) y(1) z(1)
4958 x(1) y(1) z(1)
5007 x(1) y(1) z(1)
4860 x(2) y(2) z(2)
4959...
6,320
Posted By catwoman
You could try typing... ctrl-v ctrl-i ...
You could try typing...

ctrl-v ctrl-i

..for the tab character. I find this works.
9,908
Posted By catwoman
Awk formatting of a data file - nested for loops?
Hello - is there any way in awk I can do...


4861 x(1) y(1) z(1)
4959 x(1) y(1) z(1)
5007 x(1) y(1) z(1)
4861 x(2) y(2) z(2)
4959 x(2) y(2) z(2)
5007 x(2) y(2) z(2)
4861 x(3) y(3) z(3)...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 07:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy