How could I write a shell script to substitute ^M with ^N. The file is huge almost 5mb. I want to automate the procedure, hence, i assume vi commands won't be helpfule.
Typically when you FTP a Windows document in BINARY form all the <CR><LF> ( ^M^J ) don't get translated to just <LF> (^J) and then when you try to view it in like VI you will see ^M at the end of every line.
If you FTP in ASCII mode as opposed to BINARY mode it will translate all the <CR><LF> to just <LF>.
Just wondering. The Problem with SED is it LINE EDITOR and therefore reads an entire line into its buffer to translate. A line is defined as terminated by a <LF>(^J).
I think it can't handle lines > 1024 or 4096 characters and if your file is missing the LF, it could cause SED to overrun its buffer.
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.