cancel
Showing results for 
Search instead for 
Did you mean: 

How to append two CSV files using ftp

Former Member
0 Kudos

Hi

Please let me know the FTP command to append the two .CSV files into one .CSV file.

e.g.

Let me explain:

one CSV file has the fields F1 , F2, F3 , F4 and has 5 records

another CSV file has the same sequence of fields F1, F2, F3, F4 and has 10 records

after appending both the files , I must get 15 records.

Thanks

Alok

Accepted Solutions (1)

Accepted Solutions (1)

markus_doehr2
Active Contributor
0 Kudos

There is no FTP command to do this (FTP is used to transfer files from one system to the next).

You can however do

cat <fistfile> >> <secondfile>

Markus

Former Member
0 Kudos

Dear Markus

Thanks for yr reply.

I meant for UNIX command actually, we are using CD,PUT,BIN commands.

Now My question here is:

Are you sure about CAT command? Will it solve my issue the way i want?

Alok

markus_doehr2
Active Contributor
0 Kudos

> I meant for UNIX command actually, we are using CD,PUT,BIN commands.

PUT and BIN are NO Unix commands, they belong to the FTP program.

> Now My question here is:

> Are you sure about CAT command? Will it solve my issue the way i want?

Why not simply try it out?

Markus

Former Member
0 Kudos

Thanks again for your information.

I cant try out any command as I am not authorized for that. Also I dont have vast knowledge of FTP concept. So based on my first thread please answer and make me assure that CAT will work according to the requirement.

If u have any doubts on my req then let me know

Alok

Edited by: Alok Kashyap on Sep 16, 2008 1:00 PM

markus_doehr2
Active Contributor
0 Kudos

You can try to use APPEND as command to upload the file instead of PUT.

Markus

Former Member
0 Kudos

Ok I will try out.

I am illustrating my requirement as follow

File#1 (type .CSV)

F1 F2 F3 F4

100 566 89 86

235 256 56 12

File#2 (type .CSV)

F1 F2 F3 F4

56 56 98 102

12 23 36 523

23 56 56 89

Now we want to Append File#1 to File#2 as follow:

F1 F2 F3 F4

100 566 89 86

235 256 56 12

56 56 98 102

12 23 36 523

23 56 56 89

Please suggest now that which command would be appropiate.

Alok

markus_doehr2
Active Contributor
0 Kudos

I can´t tell you any syntax since I don´t know your operating system.

Start the ftp program and enter "help append".

Markus

Former Member
0 Kudos

Say my OS is UNIX, then will APPEND or CAT work?

markus_doehr2
Active Contributor
0 Kudos

"Unix" is a generic term.

It can be

HP-UX

AIX

Solaris

Linux

<...>

Again the question: Why not simply try it out?

Markus

Former Member
0 Kudos

Thanks Markus for your continuous and timely support. We are trying out the suggested options, will get back to you if required.

Thanks again.

former_member204746
Active Contributor
0 Kudos

try this:

cat file1 >concat.txt

tail +1 file2 >>concat.txt

Answers (0)