Networking
1752750 Members
5119 Online
108789 Solutions
New Discussion юеВ

cannot transfer CSV Files from linux to windows correctly

 
SOLVED
Go to solution
'chris'
Super Advisor

cannot transfer CSV Files from linux to windows correctly

hi

I have a big problem and need really help.
I should transfer CSV files from linux to the WIN2000 ftp server via perl script, but all files after transfer are currupt.
and no matter how I ftp these files:
perl script, from shell Konsole,gftp,
passive transfer,ascii or binary.
they are always corrupt after ftp transfer.

should I encode or convert to the MS Windows format and how it works using perl ?

I can only transfer via ftp these files.

windows to windows transfer all files correctly.

kind regards
chris
27 REPLIES 27
harry d brown jr
Honored Contributor
Solution

Re: cannot transfer CSV Files from linux to windows correctly

Because windows is stupid, you probably have to do a unix2dos conversion first before transfering them. It adds a carriage return or line feed (I forgot which is which) (^M) to the end of each line.
Live Free or Die
'chris'
Super Advisor

Re: cannot transfer CSV Files from linux to windows correctly

hi

I've tried to convert with unix2dos, but still doesn't work.

greetings
chris
harry d brown jr
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

on your windoze box try using "rcp":

C:\stupidmachine\ rcp -b linuxbox.root:/some directory/* .

your linux box has to "trust" the windoze box (man that is scary).

live free or die
harry
Live Free or Die
Victor BERRIDGE
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

Hi,
How about considering the use of samba?
That should work as I do something of the sort for my SAS users who need to recuperate the csv file into excel from a shared drive mounted on their PCs.

All the best
Victor
'chris'
Super Advisor

Re: cannot transfer CSV Files from linux to windows correctly

I can use ftp only.
I cannot use samba over the internet.
Victor BERRIDGE
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

Could it be something to do with charset? Like for mail?
set crt=21
set encoding=8bit
set charset=iso-8859-1

Just thoughts...

Good luck

Victor
harry d brown jr
Honored Contributor

Re: cannot transfer CSV Files from linux to windows correctly

Are you ftp'ing from windows or TO windoze? If TO, what FTP server on windoze are you using?

Have you tried to move a single file manually to windoze, then move it back to linux to see if it is actually corrupted? (of course use BINARY mode both ways).

What errors on windoze do you get?

live free or die
harry
Live Free or Die
'chris'
Super Advisor

Re: cannot transfer CSV Files from linux to windows correctly

maybe yes and I think so, but how to encode these files using perl ?
'chris'
Super Advisor

Re: cannot transfer CSV Files from linux to windows correctly

hi harry

I cannot control the remote server.

I transfer all files from LINUX TO WINDOWS.

on the remote site it's:
220 szhstorage Microsoft FTP Service (Version 5.0).

if I do ftp transfer from any windows maschine to this remote Mickysoft server all files are OK.

but all files transfered from linux are corrupt.

I've tried to move this file from linux to windows, move back to linux, transfer again, but still corrupt.