I a have a delimited file that has a 2 column which I need to read and pull out both columns from the file.Now the while pulling out the second column and storing in a variable I get a \r\n charachter embedded in the output when an od -c is run.How can I remove the \r\n columns from the file.
example : File name : XYZ.DAT
Column 1!$#$!Column 2
ABC!$#$!123
DEF!$#$!456
This is the command I run :
SN_PRD_FILE_CNT=`cat XYZ.DAT | head -2|tail -1 | awk -F '[!][$][#][$][!]' '{print $2}' |od -c
When storing in a variable and redirecting the same to an output file I get the enter (\r\n) included.need to attain only 123