I have to write a script in informatica, which is used to combine two remote flat files
file transfer the file using ftp then perform cat command to combine files
ftp -ivn << eof
open <ip address>
user <username> <password>
binary
get file1
bye
eof
cat file1 file2 > outfile
Hi
Thanks.
Mean while i tried with the following script. Please let me know ur comments on this.
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
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
#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??