× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



it can also be done in QSH/PASE, I found the following at stackoverflow:

Using tr
tr -d '\15\32' < windows.txt > unix.txt

OR

tr -d '\r' < windows.txt > unix.txt

Using perl
perl -p -e 's/\r$//' < windows.txt > unix.txt

Using sed
sed 's/^M$//' windows.txt > unix.txt
OR
sed 's/\r$//' windows.txt > unix.txt

Using awk
awk 'BEGIN{RS="^$";ORS="";getline;gsub("\r","");print>ARGV[1]}' file.ext




be careful is used in QSH you resulting file will be CCSID of your job(most likely 37 for USA)
if done in PASE it will be 819


if used do some checking. I used DSPF command then F-10, display hex, you should see "0D0A" replaced by "0A"

https://stackoverflow.com/questions/16768776/convert-line-endings

Bryan
(I'm not the best at shell stuff, but find it interesting)


Roger Harman wrote on 3/21/2018 4:59 PM:
I tend to use Visual Code or NotePad++ but a script I've been working on was griping about CRLF as a line ending character.

Opened it in EDTF and changed EOL to *LF and QSHELL was a happy camper.

I know that *NIX defaults to LF but is there any option to get QSHELL to like CRLF ended lines?

Thanks.

Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.