I have a .csv sheet with 3 columns and 'n' number of rows.
Column1: It defines the name of the Rule. Column2: This is the schema line present in all the test files. Column3: This is the line which has to replace the schema line (column 2).
**Rule FINDSCHEMA REPLACESCHEMA**
BV1013_1-1 <xlink:type="simple" /> <xlink:type="simple_ars" />
BV1013_1-2 <xlink:type="simple" /> <xlink:type="simple_arg" />
BV1014-1 <xlink:type="simple" /> <xlink:type="simple_qrs" />
Basic Idea:
And then I have a folder (logs/BV*.log) which contains 8k+ .log files. These log files contains the a line (as defined in the second column of .csv, actually it is same in all the files.
What is the Aim??
I would like to write a bash script:
Step1: It should read the .csv file line by line
Step2: Based on the cell name in column 1, it should find all the files with this name from the (logs/) folder.
Step3: find the string as defined in column 2 in those files.
Step4: And replace it with the string from column3.
Any help is valuable.
0 Answers