I have a file (A.txt ; sep="\t") :
blabla lili
bloblo lulu
and I want to print in a specific place certain data of A.txt in B.txt in order to generate C.txt.
B.txt (sep=","):
kit
Software Version =
Date And Time of Export =
Experiment Name =
Instrument Software Version =
Instrument Type = CFX
Instrument Serial Number =
Run Start Date =
Run End Date =
Run Operator =
Batch Status = VALID
Method = Novaprime
Date And Time of Export,Batch ID,Sample Name,Well,Sample Type,Status,Interpretive Result,Action*,Curve analysis
,,,,,,,,,,
*reporting.
Example for C.txt (sep=","):
kit
Software Version = lili
Date And Time of Export =
Experiment Name =
Instrument Software Version =
Instrument Type = CFX
Instrument Serial Number =
Run Start Date = lulu
Run End Date =
Run Operator =
Batch Status = VALID
Method = Novaprime
Date And Time of Export,Batch ID,Sample Name,Well,Sample Type,Status,Interpretive Result,Action*,Curve analysis
,,,,,,,,,,
*reporting.
The trick is to set " = " as separator for B.txt in order to print the data of A.txt in the $2 of B.txt. I've try stuff like:
awk 'BEGIN{OFS=FS=" = "} NR==2{stuff} ; NR==8{stuff} } 1' A.txt B.txt > C.txt
But i didn't figure it out. Any ideas?
Thanks
B.txtin that it doesn't have a very consistent structure: The first line only has one field, then there are several lines with=-style assignments, and then (just) one line that is actually CSV ... ? Also (and even more important), how do we determine which entry inA.txtis to be pasted to which line inB.txt- is theblablaandblobloinA.txtcompletely irrelevant, or does it actually indicate where inB.txtthe following string belongs?