Topic "CR/LF being replaced with LF during scripted transfer"

Author Message
doughtsh
[View user's profile]

Joined: 2009-05-06
Posts: 2
Using v4.1.8 on Windows Server 2003
I'm using WinSCP in a SQL Server 2005 Integration Services package (Execute Process task) as follows

Executable: C:\Program Files\WinSCP\WinSCP.exe
Arguments: -script=\\dcf\data$\shared_sh\mirror.txt

Contents of mirror.txt (redacted)

option batch on
option confirm off
open sftp://username:password@server.IP.address:22
option transfer ascii
put \\dcf\data$\Shared_SH\mgnfin_leg_dignity_6_0409.csv
put \\dcf\data$\Shared_SH\mgnfin_leg_dignity_6_0409.sum
close
exit

The two files being transferred are plain text with CR/LF line delimiters (I've doublechecked this with a hex editor!). The files transfer fine but I've had a message back from the recipient that CR/LF has been replaced with LF in the file. I have no idea what software is running at the other end. I can't see an option in the help for setting the line delimiter in a script. If it's relevant, I have to use UNC names as mapped drives are not available to the domain account which runs the process.

Any tips?

Thanks
Scott
Advertisements
Freitag
[View user's profile]

Joined: 2007-10-25
Posts: 51
Use binary transfer mode instead of ascii and the translation should stop.

The manual setting of mode should also circumvent any automatic text mode, but you might have to remove the rule for that file type if it does not.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Exactly. Use "option transfer binary".
See documentation to understand transfer modes.
_________________
Martin Prikryl
doughtsh
[View user's profile]

Joined: 2009-05-06
Posts: 2
Thank you both. My initial reasoning was that if I'm sending a text file, the transfer mode should be ASCII but reading the suggested page in the manual explained why that was wrong, so I've learned something which is more generally useful.

Scott
Arshia

Guest


Hi ,

I have a .txt file on windows which is being ftp'd to windows folder. File looks aligned (line by line ) on the server.
But the same file data looks jumbled once ftp'd. Can some one please tell me how to get over this?

Ex of files that I am seeing on server and windows

On server :

a|b|c|d
e|f|g|h

On windows :

a|b|c|d|e|f|g|h

Each line is a record and we would like to see it (in windows) the way it is on server. I tried using binary option but it is still the same.
Arshia

Guest


Hi,

I got the solution for the above posted issue. I used ASCII m ode instead of BINARY. Now on windows file data looks aligned.

Thanks,
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License