Hello,
I have a simple question, hope that somebody would help.
As i just browse a little about AWK, i don't really understand how to interprete my idea into AWK syntax.
File1
A1;Input1;A3;A4;A5
20;90;77;88;99
33;80;81;67;54
32;76;55;13;93
..
..
..
File2
B1;Input2;B3;B4;B5
22;93;71;68;89
31;60;21;87;74
39;96;57;83;27
..
..
..
What I want to do is :
Check the first row, second column (name it as xstr)
- if xstr = Input1
column should be taken : 3rd & 4th column (A3,A4)
- if xstr = Input2
column should be taken : 1st & 5th column (B1,B5)
Put those positions in one file.. which will look like this
A3;A4;B1;B5
77;99;22;89
..
..
That's the idea...
so, please help me interprete this with awk...
thanks in advance
I have a simple question, hope that somebody would help.
As i just browse a little about AWK, i don't really understand how to interprete my idea into AWK syntax.
File1
A1;Input1;A3;A4;A5
20;90;77;88;99
33;80;81;67;54
32;76;55;13;93
..
..
..
File2
B1;Input2;B3;B4;B5
22;93;71;68;89
31;60;21;87;74
39;96;57;83;27
..
..
..
What I want to do is :
Check the first row, second column (name it as xstr)
- if xstr = Input1
column should be taken : 3rd & 4th column (A3,A4)
- if xstr = Input2
column should be taken : 1st & 5th column (B1,B5)
Put those positions in one file.. which will look like this
A3;A4;B1;B5
77;99;22;89
..
..
That's the idea...
so, please help me interprete this with awk...
thanks in advance