I have a fileA and a fileB. In fileA, I want my script to find for a specific stringA; then, with
sed command paste only a part of stringA on a file B (replacing with part of a specific stringB in fileB).
fileA ashdjkahsjd asjkdhajsdh Recommended Weight: 0.546 (this is the string of interest)
fileB asdajskdha kjashdjahsd WGHT 0.495 (this is the part of FILE B I need to replace)
I want to select only the text of stringA (0.546) and replace 0.495 on fileB with 0.546, so, new fileB will be:
NEW fileB asdajskdha kjashdjahsd WGHT 0.546
sed doesn't work for me because it replaces a stringA with a stringB in the same file, but my stringsA and B are from different files. Also, they are generated "randomly" (via a program).