You're right, you don't need those variables. I think I was trying to get
it to tag the file properly in one line and got myself mixed up.
> ls -S cat4.csv cat5.csv cat6.csv
ls: 001-2113 Error found getting information for object cat6.csv. No
such path or directory.
819 cat4.csv 819 cat5.csv
$
> cat cat4.csv
123456
123456
$
> cat cat5.csv
098765
098765
$
> od -x cat4.csv
0000000 3132 3334 3536 0d0a 3132 3334 3536 0d0a
0000020
$
> od -x cat5.csv
0000000 3039 3837 3635 0d0a 3039 3837 3635 0d0a
0000020
$
> echo $QIBM_CCSID
0
$
> echo $QSH_REDIRECTION_TEXTDATA
Y
$
> cat -c cat4.csv cat5.csv > cat6.csv
$
> ls -S cat6.csv
37 cat6.csv
$
> od -x cat6.csv
0000000 3132 3334 3536 0d0a 3132 3334 3536 0d0a
0000020 3039 3837 3635 0d0a 3039 3837 3635 0d0a
0000040
$
> setccsid 819 cat6.csv
$
> cat cat6.csv
123456
123456
098765
098765
$
If the file exists, though you'll run in to issues:
> ls -S cat6.csv
819 cat6.csv
$
> cat -c cat4.csv cat5.csv > cat6.csv
$
> od -x cat6.csv
0000000 9116 9394 9596 0d8e 9116 9394 9596 0d8e
0000020 9099 9804 9695 0d8e 9099 9804 9695 0d8e
0000040
$
Setting QSH_REDIRECTION_TEXTDATA=N fixes it, though:
> QSH_REDIRECTION_TEXTDATA=N cat -c cat4.csv cat5.csv > cat6.csv
$
> od -x cat6.csv
0000000 3132 3334 3536 0d0a 3132 3334 3536 0d0a
0000020 3039 3837 3635 0d0a 3039 3837 3635 0d0a
0000040
----- Original message -----
From: John Yeung <gallium.arsenide@xxxxxxxxx>
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Cc:
Subject: Re: merging 2 .csv files
Date: Thu, Dec 29, 2016 12:07 PM
On Thu, Dec 29, 2016 at 12:50 PM, Kevin Adler <kadler@xxxxxxxxxx> wrote:
> John, the redirection will be opened by the shell, which will
> automatically do text conversion regardless of whether cat does so
or not.
I have no reason to doubt your expertise, but I've tried cat -c on my
system, in QSH, and it preserves the CRLF line endings.
My QSH shell variables include
QIBM_CCSID=0
QSH_REDIRECTION_TEXTDATA=Y
I'm certainly open to the possibility that my system is set up in a
weird way. But cat -c works for me. Without futzing with variables.
John Y.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: [1]
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at [2]
http://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: [3]
http://amzn.to/2dEadiD
References
Visible links
1.
http://lists.midrange.com/mailman/listinfo/midrange-l
2.
http://archive.midrange.com/midrange-l
3.
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.