Thanks all, I was able to solve the problem. What I didn't know until I debuged it with the sh -x command is that when I move the data from the file to a variable i get the data\r So I solved it with the following command.
for i in `<file1 awk '{$1 == "FieldName:"} print $2}' |
awk...
Thanks I finally figured it out. When I get the data from the file into $i it has the \r on the end of the data ex. "loan_dt\r" cannot see this with any editor finally found it by doing sh -x to debug the shell. Didn't know that command. I fixed it by running it through another awk...
I need help! I am trying to use sed in a for loop and does not seem to be working correctly.
If I have a file called file2 that contains:
Field: LOAN_DATE
and I do:
i="loan_date"
sed -i "s/${i}/${i}/I" file2
This works replacing LOAN_DATE with loan_date
The problem is when I put this in a...
Thanks for any help.
I have 2 files and I am reading in the second file and reformating it with output going to a third file. My problem is I need to read the first file and compare with second file and if data in a field matches I need to replace it with the data from the first file. The...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.