How to combine to flat files which are there in remote server ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to combine to flat files which are there in remote server ?
# 1  
Old 08-01-2006
Network How to combine two flat files which are there in remote server ?

Smilie I have to write a script in informatica, which is used to combine two remote flat files

Last edited by srinivasaraju.m; 08-01-2006 at 08:04 AM.. Reason: mistake in title
# 2  
Old 08-04-2006
file transfer the file using ftp then perform cat command to combine files

Code:
ftp -ivn << eof
open <ip address>
user <username> <password>
binary
get file1
bye
eof

cat file1 file2 > outfile

# 3  
Old 08-04-2006
Thanks for ur reply

Hi

Thanks.

Mean while i tried with the following script. Please let me know ur comments on this.
Code:
FTPSVR=IP address
FTPUSR=username
FTPPWD=password
FTPDIR=/dir path
export FTPSRV FTPUSR FTPPWD FTPDIR

ftp -n $FTPSVR << !
quote user $FTPUSR
quote pass $FTPPWD
cd $FTPDIR
lcd /dir name

get filename1
get filename2

bye


The second script as,

FTPSVR=IP address
FTPUSR=username
FTPPWD=password
FTPDIR=/dir path
export FTPSRV FTPUSR FTPPWD FTPDIR


cd /tmp

cat filename1  filename2 > filename3

ftp -n $FTPSVR << !
quote user $FTPUSR
quote pass $FTPPWD
cd $FTPDIR
lcd /dir name
put filename3
bye


Last edited by blowtorch; 08-04-2006 at 03:33 AM.. Reason: add code tags
# 4  
Old 08-04-2006
As in your first post you said you need to combine two flat files residing at remote host.that can be done with this script
Code:
#this script login to remote server and execute the command there the log file will be
#session_output
( echo "user"
  sleep 2
  echo "password"
  sleep 2
  echo "cd /dir_path"
  sleep 2
  echo "cat test11.txt test12.txt>>try.txt"
  sleep 2
  echo "logout"
) | telnet ip_address > session_output

Do you need to ftp also??
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Automate splitting of files , scp files as each split completes and combine files on target server

i use the split command to split a one terabyte backup file into 10 chunks of 100 GB each. The files are split one after the other. While the files is being split, I will like to scp the files one after the other as soon as the previous one completes, from server A to Server B. Then on server B ,... (2 Replies)
Discussion started by: malaika
2 Replies

2. HP-UX

Tarring files to remote server

Hi, I need to tar some files in a directory to a remote server. I need to exclude some file from this directory and then tar it over. This is the command suggested by one article (tarring in the same server) : tar -zcvf /tmp/mybackup.tar.gz -X exclude.txt /home/me However it does not... (9 Replies)
Discussion started by: anaigini45
9 Replies

3. Shell Programming and Scripting

Copying files to remote server

I am trying to copy code to remote server, doing something like this However it is copying one file and than the script exits i=0; j=0 while read fn; do dir=${fn%/*} # Gets directory path fnm=${fn##*/} # Gets filename excl. path rgx_nwk="s/${nwk}/${nwk}.sac/g" ... (2 Replies)
Discussion started by: kristinu
2 Replies

4. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

5. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

6. Shell Programming and Scripting

Do I require remote login access to a windows server to transfer files from a UNIX server

Hi All I need to transfer a file from a UNIX server to a windows server. I saw that it is possible to do this using scp command by looking at the forum listed below: ... (2 Replies)
Discussion started by: vx04
2 Replies

7. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

8. Shell Programming and Scripting

copy files from remote server (B) to target server (A)?

Hi All, what is the comand to log off the remote server? I have 2 servers A, B. I need to find all files older than 7 days on server B and copy over to server A. My logic is: login the remote server: ================= ssh hostB cd /data/test find . -mtime -7 -ls | awk '{print... (4 Replies)
Discussion started by: Beginer0705
4 Replies

9. Shell Programming and Scripting

Need to get specified number of files from remote server

Hi All, I need to get a specified number of files from a remote server. The remote server has a huge number of files to the tune of more than 200000. If I use scp or rsync to transfer files using the wildcard "*", am getting the error "arg list too long" So, I would like to know if i can... (2 Replies)
Discussion started by: umavmishra
2 Replies

10. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies
Login or Register to Ask a Question