Wednesday 11 September 2013

Change encoding of text file (shell archive or script for antique kernel text to ASCII text, with CRLF, LF line terminators)

Change encoding of text file (shell archive or script for antique kernel
text to ASCII text, with CRLF, LF line terminators)

I'm writing a small bash script to look up the 1st line of FILEA in FILEB,
if it matches then it returns over a text with the filename.
Problem is when i'm extracting text from FILEA and then comparing it with
a simple == as an if condition, it returns as different.
I've narrowed down the issue being to the encoding of the 2 files i'm
using being different
(FILEA=shell archive or script for antique kernel text)
(FILEB=ASCII text, with CRLF, LF line terminators)
Is there a way to convert FILEA to ASCII to avoid this issue when
comparing through UNIX? Or outside of UNIX would work for me too.
Really appreciate any help or comment.
Thanks

No comments:

Post a Comment