Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
-
Print a first column for every two rows that has the same value followed by a string.
-
Match on the fourth column for every two rows and if
a. Both values are positive, print another column saying z=0,color=pink for both rows.
b. Both values are negative, print another column saying z=0,color=violet for both rows.
c. If first is positive and second is negative, print another column saying z=0,color=yellow for both rows.
d. If first is negative and second is positive, print another column saying z=0,color=brown for both rows.
So, My final output will be
link1 axis1 0 1 10 z=0,color=pink
link1 axis2 0 1 5 z=0,color=pink
link2 axis1 1 2 -4 z=0,color=violet
link2 axis2 2 3 -3 z=0,color=violet
link3 axis1 3 4 5 z=0,color=yellow
link3 axis2 3 4 -1 z=0,color=yellow
link4 axis1 4 5 -6 z=0,color=brown
link4 axis2 4 5 1 z=0,color=brown
I was able to print the first column as a series but didn't get to know how to make two values the same and at two row intervals.