Networking
1753797 Members
7294 Online
108799 Solutions
New Discussion юеВ

Re: cannot transfer CSV Files from linux to windows correctly

 
SOLVED
Go to solution
Victor BERRIDGE
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

Could you describe what corruption you have, since you transmetted file is pur ascii how does it get modified?

Courage!
Ganesh Babu
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

could u post a corrupted file and a good one???

Ganesh
Bruno Ganino
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

'chris'
Super Advisor

Re: cannot transfer CSV Files from linux to windows correctly

good file looks:
---------------------------------------------------------------------------------------
I,ZZ0387778,Name Firstname,USD,street 166,city,,,,B:266.27.07,3654,USD,P:351.15.79,,,DE,USD107,
I,ZZ0387780,Name Firstname,USD,street,city,,,,B:792.58.50,6344,USD,P:485.29.85,,,DE,USD001,
I,ZZ0274516,Name Firstname,USD,street 2,city,,,,B:834.33.23,3292,USD,P:284.89.60,,,DE,USD033,
I,ZZ0558613,Name Firstname,USD,street 102,city,,,,,8032,USD,P:383.31.96,,,DE,USD999,
---------------------------------------------------------------------------------------

bed file (after ftp transfer) looks:
---------------------------------------------------------------------------------------
I,ZZ0387778,Name Firstname,USD,street 166,city,,,,B:266.27.07,3654,USD,P:351.15.79,,,DE,USD107,
I,ZZ0387780,Name Firstname,USD,street,city,,,,B:├Г ├Г d├Г┬о├Г ├Г k├В┬г├Г┬░9├Г ├Е┬б├Г ├Г ├Г┬╝├В┬▒R├Г┬й├Г Z├Г┬╣├Г┬╝├Г┬б├Г ├Г ├Г ├Г┬╛
I,ZZ0274516,Name Firstname,USD,street 2,city,,,,B:834.33.23,3292,USD,P:284.89.60,,,DE,USD033,
I,ZZ0558613,Name Firstname,USD,street 102,city,,,,,8032,USD,P:383.31.96,,,DE,USD999,
---------------------------------------------------------------------------------------

with xftp works, but I cannot use it in my case.
what can xftp, what the others cannot do ?
how to to simulate xftp using perl ?
may
Ganesh Babu
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

Ganesh Babu
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

i am not sure whether this will work.. but try transfer of file in binary mode itself..

Because in the More information section of my previous link says

The FTP protocol offers two types of transfers: binary and ASCII. In a binary download (which is always used by the ITC), the FTP server sends to the client the exact contents of a file. In a binary upload, the FTP server stores exactly what the client sends. This is desirable behavior for most types of files, such as executable programs, images, word processor documents, and so on.

Ganesh

'chris'
Super Advisor

Re: cannot transfer CSV Files from linux to windows correctly

hi

I've tried already to transfer binary, but it doesn't work either.

I get these files from a IBM machine and they are encoded in EBCDIC, I think.
I should rename files and send automatically via ftp to the remote windows machine.

the solution can be, to encode using perl from EBCDIC to the windows standard ?
Bruno Ganino
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

Hi Chris, read this document. It is interesting...
http://www.microsoft.com/technet/itsolutions/migration/linux/mvc/lintowin.mspx

HTH
Bruno
Torino (Turin) +2H
Victor BERRIDGE
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

Hi chris,
Is your IBM an mainframe mvs/OS390 ?
I would start by looking at the files transmetted from IBM to linux.
Is the file what you expect? when you look at it with vi , all seems mormal?

There are 2 cases with tranfer to mainframes:
ascii/ebcdic and block format
You can ask the mainframe to translate to ascii
From /to a GCOS system I had to use dd:
dd if= of= cbs= conv=unblock
I would try with the option conv=unblock, then pass this file through ux2dos> "file_for_win"
If I can think of something else I will let you know, keep us informed

Good luck and all the best
Kind regards
Victor
'chris'
Super Advisor

Re: cannot transfer CSV Files from linux to windows correctly

hi

OS from the IBM maschine is AS400.
If I look this file with vi or kwrite looks always fine.

and what about lenght for fixed block size ?

The files, which I get from AS400 have each time differnt size.

I played a little bit with language settings from linux and for a short time all transfers were correctly, but after reboot like before.

and xftp from
http://www.llnl.gov/ia/xftp.html
transfer all files always correctly.

knows someone, if I can use xftp from shell Konsole or use it in combination with a perl script ?

greetings
chris