I know very little, so please if you can help, make it as easy as possible for me to understand. I am getting better though thanks to everyone's help!
Here goes!
I have several files named file1, file2, file3, etc.
I would like to use nawk, and output the files to different
files named block_obj_1, block_obj_2, block_obj_3, and so on using the original file #
I do have a temp directory to send them to.
The internal file looks similiar to the below, but have different numbers in each file:
RXOTS-11-0-0 CONFIG 638 2 7 7481 TCH
RXOTS-11-0-1 CONFIG 638 2 6 7488 TCH
RXOTS-11-0-2 CONFIG 638 2 5 7503 TCH
RXOTX-11-0 CONFIG 638 2 45 YES NONE
RXOTX-11-1 CONFIG HOP 5 45 NO NONE
RXOTX-11-2 CONFIG HOP 6 45 NO NONE
RXOTX-11-4 CONFIG 629 1 45 YES NONE
RXORX-11-0 CONFIG HOP NONE
RXORX-11-1 CONFIG HOP NONE
RXORX-11-2 CONFIG HOP NONE
MO CELL CHGR
RXOTG-11 B00227A 0
B00227B 0
B00227C 0
B00227A 1
B00227B 1
B00227C 1
RXOTG-11
DEV DCP APUSAGE APSTATE TEI
RBLT24-264 1 UNDEF IDLE
RBLT24-265 2 UNDEF IDLE
I need to grep on the first field for RXOTS, RXOTX, and RXORX (In that order).
So it would only find:
RXOTS-11-0-0
RXOTS-11-0-1
RXOTS-11-0-2
RXOTX-11-0
RXOTX-11-1
RXOTX-11-2
RXOTX-11-4
RXORX-11-0
RXORX-11-1
RXORX-11-2
Then for every RXOTX it found it would create text below it like:
RXOTRX-11-0
RXOTRX-11-1
RXOTRX-11-2
RXOTRX-11-4 Basically it would just create a new line of text adding an R to it for each TX found.
So then my output would be:
RXOTS-11-0-0
RXOTS-11-0-1
RXOTS-11-0-2
RXOTX-11-0
RXOTX-11-1
RXOTX-11-2
RXOTX-11-4
RXORX-11-0
RXORX-11-1
RXORX-11-2
RXOTRX-11-0
RXOTRX-11-1
RXOTRX-11-2
RXOTRX-11-4
Below the TRX portion, I need the following added using the first number only (EXAMPLE BELOW):
RXOCON-11
RXODP-11
RXOIS-11
RXOTF-11
RXOCF-11
RXOTG-11
I want to end up with text similiar to below:
RXOTS-11-0-0
RXOTS-11-0-1
RXOTS-11-0-2
RXOTX-11-0
RXOTX-11-1
RXOTX-11-2
RXOTX-11-4
RXORX-11-0
RXORX-11-1
RXORX-11-2
RXOTRX-11-0
RXOTRX-11-1
RXOTRX-11-2
RXOTRX-11-4
RXOCON-11
RXODP-11
RXOIS-11
RXOTF-11
RXOCF-11
RXOTG-11
The first and second number will be different in each file1, file2 and so on. The only thing
uniq is RXOTS, RXOTX, RXORX.
I know this is alot, and is similiar to a former post, but it is different, I promise!
Thanks as always!
Beaster
Here goes!
I have several files named file1, file2, file3, etc.
I would like to use nawk, and output the files to different
files named block_obj_1, block_obj_2, block_obj_3, and so on using the original file #
I do have a temp directory to send them to.
The internal file looks similiar to the below, but have different numbers in each file:
RXOTS-11-0-0 CONFIG 638 2 7 7481 TCH
RXOTS-11-0-1 CONFIG 638 2 6 7488 TCH
RXOTS-11-0-2 CONFIG 638 2 5 7503 TCH
RXOTX-11-0 CONFIG 638 2 45 YES NONE
RXOTX-11-1 CONFIG HOP 5 45 NO NONE
RXOTX-11-2 CONFIG HOP 6 45 NO NONE
RXOTX-11-4 CONFIG 629 1 45 YES NONE
RXORX-11-0 CONFIG HOP NONE
RXORX-11-1 CONFIG HOP NONE
RXORX-11-2 CONFIG HOP NONE
MO CELL CHGR
RXOTG-11 B00227A 0
B00227B 0
B00227C 0
B00227A 1
B00227B 1
B00227C 1
RXOTG-11
DEV DCP APUSAGE APSTATE TEI
RBLT24-264 1 UNDEF IDLE
RBLT24-265 2 UNDEF IDLE
I need to grep on the first field for RXOTS, RXOTX, and RXORX (In that order).
So it would only find:
RXOTS-11-0-0
RXOTS-11-0-1
RXOTS-11-0-2
RXOTX-11-0
RXOTX-11-1
RXOTX-11-2
RXOTX-11-4
RXORX-11-0
RXORX-11-1
RXORX-11-2
Then for every RXOTX it found it would create text below it like:
RXOTRX-11-0
RXOTRX-11-1
RXOTRX-11-2
RXOTRX-11-4 Basically it would just create a new line of text adding an R to it for each TX found.
So then my output would be:
RXOTS-11-0-0
RXOTS-11-0-1
RXOTS-11-0-2
RXOTX-11-0
RXOTX-11-1
RXOTX-11-2
RXOTX-11-4
RXORX-11-0
RXORX-11-1
RXORX-11-2
RXOTRX-11-0
RXOTRX-11-1
RXOTRX-11-2
RXOTRX-11-4
Below the TRX portion, I need the following added using the first number only (EXAMPLE BELOW):
RXOCON-11
RXODP-11
RXOIS-11
RXOTF-11
RXOCF-11
RXOTG-11
I want to end up with text similiar to below:
RXOTS-11-0-0
RXOTS-11-0-1
RXOTS-11-0-2
RXOTX-11-0
RXOTX-11-1
RXOTX-11-2
RXOTX-11-4
RXORX-11-0
RXORX-11-1
RXORX-11-2
RXOTRX-11-0
RXOTRX-11-1
RXOTRX-11-2
RXOTRX-11-4
RXOCON-11
RXODP-11
RXOIS-11
RXOTF-11
RXOCF-11
RXOTG-11
The first and second number will be different in each file1, file2 and so on. The only thing
uniq is RXOTS, RXOTX, RXORX.
I know this is alot, and is similiar to a former post, but it is different, I promise!
Thanks as always!
Beaster