CR/LF being replaced with LF during scripted transfer

Advertisement

doughtsh
Joined:
Posts:
2

CR/LF being replaced with LF during scripted transfer

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

Reply with quote E-mail

Advertisement

Freitag
Freitag avatar
Joined:
Posts:
52

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.

Reply with quote

doughtsh
Joined:
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

Reply with quote E-mail

Arshia
Guest

File Data looking jumbled after the file is ftp'd to windows

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.

Reply with quote

Arshia
Guest

File Data looking jumbled after the file is ftp'd to windows

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,

Reply with quote

Advertisement

You can post new topics in this forum