Sample of how to concatenate files to FTP to server

15 pts.
Tags:
Concatenate
FTP
Remote servers
I need to be able to combine three files into one then FTP them to a remote server. Does anyone have an example?

Answer Wiki

Thanks. We'll let you know when a new response is added.

A utility like WinZIP or 7zip can do this for you. This will compress the files into a single “container” file that can then be uploaded to an FTP server.

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Gilly400
    Hi, You can just use "put" for the first file, then "append" for the other 2. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Bobkberg
    Another option - if the files are all in the same folder/directory, you can also do an "mput" or "mget" with wildcards. Bob
    1,070 pointsBadges:
    report
  • Brookr
    Bobkberg, I did the mget and it worked. However, now I am faced with this: the files are still separate, it does not concatenate them. So I am now wondering how to concat them once they are on our IBM mainframe. I can't find a way to use a wildcard for the concat. I have tried to use a sort in the JCL with a wildcard but I cannot make that work. In this situation, I will never know each file name or how many there are. But the folder they are in on the ftp server will hold only those files and they will all have similar names, with a number appended, so wildcard would be great. Just can't figure out how to make it work. Any suggestions? Please? Thank you very much for anything! BrookR
    15 pointsBadges:
    report
  • Gilly400
    Hi, You could try making a small batch file to run on the PC to concatenate the files before you ftp them. Something like this :- copy filea.*+fileb.*+filec.* ftpfile.txt This should copy the 3 files to one file called ftpfile.txt which you can then ftp to your server. I would make a batch file like this :- copy filea.*+fileb.*+filec.* ftpfile.txt (run your ftp script here to send ftpfile.txt to your server) del /Q filea.* del /Q fileb.* del /Q filec.* del /Q ftpfile.old ren ftpfile.txt ftpfile.old Then I keep a copy of the last concatenated file. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Gilly400
    Hi, You may need to add /B in the copy command to avoid the copy adding an end of file character. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Brijesh
    Multiple files can be combined into one file by using the command line:
    copy *.txt newfile.txt
    For that you need to put those three files into a folder and use dir to open the folder, then use that command.
    10,185 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following