I will try and be as detailed as possible for what I need, this is quite over my head.
I have a file called rehome_input which has data similiar to the below inside which is a csv file seperated by commas:
10,5,10,113
11,16,18,123
13,23,8,2
There may be more or less rows each time I run the script. There will be a dummy file called master_rehome which has the word TG_NUM like rxcdp:mo=rxotg-TG_NUM throughout it.
So what I need is a small script which will read the first line from rehome_input file, grab the first field, and cat the master_rehome file to a new file beaster1, but substitute TG_NUM in the new cat'd file with the first field from the first line of rehome_input.
After the first line, first field, I need to move to the next line, first field in rehome_input and do the same, but the new file beaster should be created in sequence.
So I would end up with three final files: beaster1, beaster2, beaster3 if using the above and they would look like:
beaster1
rxcdp:mo=rxocf-10;
rxmop:mo=rxocf-10;
beaster2
rxcdp:mo=rxocf-11;
rxmop:mo=rxotrx-11;
beaster3
rxcdp:mo=rxocf=13;
rxmop:mo=rxocf-13;
I know this is probably really a big pain, but like I said, it is over my head.
Thanks as always,
Beaster
I have a file called rehome_input which has data similiar to the below inside which is a csv file seperated by commas:
10,5,10,113
11,16,18,123
13,23,8,2
There may be more or less rows each time I run the script. There will be a dummy file called master_rehome which has the word TG_NUM like rxcdp:mo=rxotg-TG_NUM throughout it.
So what I need is a small script which will read the first line from rehome_input file, grab the first field, and cat the master_rehome file to a new file beaster1, but substitute TG_NUM in the new cat'd file with the first field from the first line of rehome_input.
After the first line, first field, I need to move to the next line, first field in rehome_input and do the same, but the new file beaster should be created in sequence.
So I would end up with three final files: beaster1, beaster2, beaster3 if using the above and they would look like:
beaster1
rxcdp:mo=rxocf-10;
rxmop:mo=rxocf-10;
beaster2
rxcdp:mo=rxocf-11;
rxmop:mo=rxotrx-11;
beaster3
rxcdp:mo=rxocf=13;
rxmop:mo=rxocf-13;
I know this is probably really a big pain, but like I said, it is over my head.
Thanks as always,
Beaster