Sponsored Content
Top Forums Shell Programming and Scripting SFTP with ASCII file transfer Post 302288202 by govindts on Monday 16th of February 2009 05:24:35 PM
Old 02-16-2009
SFTP with ASCII file transfer

Hello -

I have text file and need to load the data in Oracle through sqlloader.
I need to move this file to unix server and load into oracle. When i SFTP(unfortunately i do not have FTP)
to unix box, each line is appended with ControlM character...
since it is transferring in BINARY format.. I checked the SFTP help.. Here is the help info.

Code:
Unfortunately not.

Until recently, this was a limitation of the file transfer protocols: the SCP and SFTP 
protocols had no notion of transferring a file in anything 
other than binary mode. (This is still true of SCP.)

The current draft protocol spec of SFTP proposes a means of implementing ASCII transfer. 
At some point PSCP/PSFTP may implement
 this proposal.



After sftping the text file into unix, here is the file content.


Code:
F2|Invoice||x^M
F2B|Nota fiscal||x^M
G2|Credit Memo|x|x^M
G2B|Credit memo BR|x|x^M
L2|Debit Memo||x^M
L2B|Debit memo BR||x^M
RE|Credit for Returns|x|x^M
REB|Ret. credit memo BR|x|x^M
S1|Cancel. Invoice (S1)|x|x^M
S2|Cancel of Cred Memo||x^M
WIA|Plants Abroad||x^M
Z2|Revenue Recong.Billi||x^M
ZFVB|BR Contract Invoice||x^M
ZFVI|Invoice Contract||x^M
ZL2|Debit Memo||x^M
ZL3|Debit Memo Deposit||x^M
ZL4|Credit Memo Deposit|x|x^M
ZFIN|MAC Order ||X^M
ZMSV| Monthly Maintenance Invoice||X^M
ZREY| Avaya Install Rev Recognition (no customers)||X^M
ZTMI| T&M or Term Fees||X^M
ZVMI| Managed Services Mac Order||X^M
ZVSV|Managed Services Maintenance ||X^M


Sqlloader treats ^M as another character and trying to load that charcter...

My sqlloader is failing due to this reason.. How can i handle this situation?

Please let me know if you see any possible solutions...

One option would be to remove this ^M character before we load it. But i don't know how to remove this character...

Any help please....
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

sftp command for file transfer

hi, I need to sftp a file from one unix system to another unix system. eg: filename is test.txt servername : abc@xyz please give me the sftp command for that. thanks in advance.. mohan.p (2 Replies)
Discussion started by: mohanpadamata
2 Replies

2. HP-UX

SFTP Protocol: How to transfer the file in PC Format

Hi, We are facing issue with files transfered using SFTP in Hp-UX. The transfered files are in Unix Format. That is, file format as UNIX (LF) instead of a PC format (CR & LF). How can we achieve file transfers as PC format using SFTP? Your help and input will be highly appreciated. ... (2 Replies)
Discussion started by: brap45
2 Replies

3. Shell Programming and Scripting

sftp file transfer

hi i am trying to login to remote server using SFTP Protocol and trying to upload a file butit is asking for the password. Note: I am trying to connect to FrontEnd server sftp SFTREGUP1@14.71.26.6 Connecting to 14.71.26.6... Password Authentication Password: Please help (14 Replies)
Discussion started by: Satyak
14 Replies

4. Shell Programming and Scripting

SFTP file transfer mode question

I am having trouble viewing a file in ASCII after doing a 'get' using SFTP. It appears to have come across as machine language. Does the file have to be in ASCII format prior to the 'get' or is there a way to convert it to ascii after I get it onto my server? I have read where the secure file... (0 Replies)
Discussion started by: wsiefkas
0 Replies

5. Shell Programming and Scripting

Shell script to transfer file via SFTP

Hi all, I'm trying to do a script to transfer file between my server and an external server via SFTP protocol. It doesn't use rsa key, but password. When I run the script, it throw back a prompt that request me to put the password. How should I do for automatic login? Pleaes help :( ... (2 Replies)
Discussion started by: Kapom
2 Replies

6. Shell Programming and Scripting

Passwordless file transfer using sftp

Hello all, I have a requirement, in which we need to stage a package to Unix remote server in an automation (we cant use ssh key generation) , do u have any idea how we can transfer the package to remote server using sftp .if you have any script plz share it to me (4 Replies)
Discussion started by: Ramji Sundaram
4 Replies

7. Shell Programming and Scripting

File transfer using SFTP

Hi, I want to a transfer file from remote machine to a local machine using SFTP where both my local and remote machines are Ubuntu machines.So i wanted to write a unix bash script which uses SFTP command to transfer the file from remote to local machine. My remote server is 178.28.30.106. ... (14 Replies)
Discussion started by: shree11
14 Replies

8. UNIX for Dummies Questions & Answers

SFTP File transfer issue

Hi guys, Need a quick and urgent help on below issue. One of our application is try to transfer the file to another host thru sftp process My file is about 1 GB. Job is getting hung while transferring the file. So when I login as sftp and check the file system space is only in MB... (2 Replies)
Discussion started by: Vinoth Kumar G
2 Replies

9. UNIX for Dummies Questions & Answers

Transfer image file from local to remote with sftp

Hi. I have managed to transfer a file from remote to my raspberry pi, but I have the camera mounted on the Raspbien so I would like to transfer the image the other way. I use this line: sshpass -p 'PASSWORD' scp -- USER@ssh.servername.com:/www/cam/image.jpg /home/pi/shared/web/image.jpg (4 Replies)
Discussion started by: brickglow
4 Replies

10. UNIX for Beginners Questions & Answers

Need some help regarding file transfer between server (sftp/scp)

Hi All, Need some help regarding file transfer between server. Suppose we have system-A and system-B. To transfer file from system-A to system-B we usually share the public keys of system-A to system-B and do scp/sftp to transfer a file. Is it possible that public key of system-B can be... (3 Replies)
Discussion started by: abhi_123
3 Replies
CURLOPT_QUOTE(3)					     curl_easy_setopt options						  CURLOPT_QUOTE(3)

NAME
CURLOPT_QUOTE - (S)FTP commands to run before transfer SYNOPSIS
#include <curl/curl.h> CURLcode curl_easy_setopt(CURL *handle, CURLOPT_QUOTE, struct curl_slist *cmds); DESCRIPTION
Pass a pointer to a linked list of FTP or SFTP commands to pass to the server prior to your request. This will be done before any other commands are issued (even before the CWD command for FTP). The linked list should be a fully valid list of 'struct curl_slist' structs properly filled in with text strings. Use curl_slist_append(3) to append strings (commands) to the list, and clear the entire list after- wards with curl_slist_free_all(3). Disable this operation again by setting a NULL to this option. When speaking to a FTP server, prefix the command with an asterisk (*) to make libcurl continue even if the command fails as by default libcurl will stop at first failure. The set of valid FTP commands depends on the server (see RFC959 for a list of mandatory commands). The valid SFTP commands are: chgrp group file The chgrp command sets the group ID of the file named by the file operand to the group ID specified by the group operand. The group operand is a decimal integer group ID. chmod mode file The chmod command modifies the file mode bits of the specified file. The mode operand is an octal integer mode number. chown user file The chown command sets the owner of the file named by the file operand to the user ID specified by the user operand. The user operand is a decimal integer user ID. ln source_file target_file The ln and symlink commands create a symbolic link at the target_file location pointing to the source_file location. mkdir directory_name The mkdir command creates the directory named by the directory_name operand. pwd The pwd command returns the absolute pathname of the current working directory. rename source target The rename command renames the file or directory named by the source operand to the destination path named by the target op- erand. rm file The rm command removes the file specified by the file operand. rmdir directory The rmdir command removes the directory entry specified by the directory operand, provided it is empty. statvfs file The statvfs command returns statistics on the file system in which specified file resides. (Added in 7.49.0) symlink source_file target_file See ln. DEFAULT
NULL PROTOCOLS
SFTP and FTP EXAMPLE
TODO AVAILABILITY
SFTP support added in 7.16.3. *-prefix for SFTP added in 7.24.0 RETURN VALUE
Returns CURLE_OK SEE ALSO
CURLOPT_POSTQUOTE(3), CURLOPT_PREQUOTE(3), libcurl 7.54.0 February 25, 2016 CURLOPT_QUOTE(3)
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy