copy from one csv file to another
Hello everyone,
I was wondering if anyone could suggest a way to copy data from one csv file to another csv file.
Basically I need to copy a column of numbers from one csv file to a second column position of another csv file.
Is there an easy way to code this ?
Thanks for any suggestion !
cheers!
Re: copy from one csv file to another
do both csv files have the same number of lines?
you want to copy 1 column's value in row1 of the first file to the 2nd column in row2 of the second file (etc.)?
Re: copy from one csv file to another
Hi Paul,
yes, you are correct for both: the cvs files have the same number of lines and I want to copy file 1 column's value in in row 1 to a row1 of the 2nd column of the file 2, etc.
As an additional thing, if I may ad, I also need to ad a header at the top of the both columns of the file 2.
Thanks!
Re: copy from one csv file to another
Re: copy from one csv file to another
Paul,
you're a champ, it works perfectly with all my files.
Thank you very much for your help !
Re: copy from one csv file to another
Paul,
one more thing: the Excel file remains open after I run the code, how do you close it ?
THANKS!
Re: copy from one csv file to another
what excel file?
do you mean output.txt?
if thats it remove the process.start line
Re: copy from one csv file to another
Yes, the output.txt, I renamed it to .csv file and it opens in Excel.
So, if I remove the process.start, what does the process.start do, I don't need it ?
Thanks!
Re: copy from one csv file to another
i put the process.start line in there to show you the finished output.
it opens output.txt (or whatever you renamed it as) in its default application. its not a necessary part of the program.