× 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.



The .NET version is much simpler:

string contentswithoutCRLF = File.ReadAllText(@"C:\temp\test.txt").Replace(ControlChars.CRLF,"");
File.WriteAllText(@"C:\temp\testWithoutCRLF.txt",contentswithoutCRLF);

Once you know .NET you don't go back!


-----Original Message-----
From: Luis Rodriguez [mailto:luisro58@xxxxxxxxx]
Sent: Wednesday, August 14, 2013 4:58 PM
To: Midrange Systems Technical Discussion
Subject: Re: Replacing carriage returns in a data file

Alan,

The following "quick and dirty" code works for me:


PGM
dcl &qsh +
*char +
256

dcl &qt +
*char +
01 +
('''')


dcl &input +
*char +
128 +
value('/home/varios/QPADEV002C.CSV')
dcl &output +
*char +
128 +
value('/home/varios/output.txt')
/*-----------------------------------------------*/

chgvar &qsh +
('export QIBM_CCSID=1252;tr -d' *bcat &qt *tcat +
'\r' *tcat &qt *bcat '<' *bcat &input *bcat '>' +
*bcat &output)
QSH CMD(&QSH)

endpgm

Regards,


Luis Rodriguez
IBM Certified Systems Expert - eServer i5 iSeries

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.