i have 2 file.
analizeddata.txt:
A001->A002->A003->A004
A001->A005->A007
A022->A033
[...]
and
matrix.txt:
A001|Scott
A002|Bob
A003|Mark
A004|Jane
A005|Elion
A007|Brooke
A022|Meggie
A023|Tif
[..]
How i can replace in analizeddata.txt, or obtain a new file, with the second column of matrix.txt? The expected output file will be as:
Scott->Bob->Mark->Jane
Scott->Elion->Brooke
Meggie->Tif
[...]
Thanks
Just use
sedto replace the string what you want.sed 's/|/\//g' matrix.txtwill generate the replace pattern likesA001/Scottwhich will be used asregexp/replacementof the secondsed s/regexp/replacement/command.sed -ioption will update directly analizeddata.txt file, back up it before exec this command.