data_load_problem_how_to_join_many_csv_files_together
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
data_load_problem_how_to_join_many_csv_files_together [2008/09/11 13:58 (16 years ago)] – cliff | data_load_problem_how_to_join_many_csv_files_together [2008/09/12 09:49 (16 years ago)] (current) – cliff | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Joining Many CSV Files Together ====== | ====== Joining Many CSV Files Together ====== | ||
+ | ===== Warning ===== | ||
+ | There is a requirement that the files be the same format. The reason is there is no matching up of invoice number to invoice number and description to description. The routine just adds one file to the end of the next. If you have headers at the start of each file you should probably remove them. The routine could be upgraded to skip the first line after the first csv file, but it doesn' | ||
===== Intro ===== | ===== Intro ===== | ||
When you have many files that have to be joined together so that you don't have to do a high number of loads, here is a way to accomplish that. You need to have Microsoft Excel on the machine, and you need to be able to run macros when you open the Excel Sheet. | When you have many files that have to be joined together so that you don't have to do a high number of loads, here is a way to accomplish that. You need to have Microsoft Excel on the machine, and you need to be able to run macros when you open the Excel Sheet. | ||
Line 45: | Line 47: | ||
==== Step 2 ==== | ==== Step 2 ==== | ||
Modify a line in the code, change the path to the directory where your csv files reside. | Modify a line in the code, change the path to the directory where your csv files reside. | ||
- | <code|x> | + | < |
strFolder = " | strFolder = " | ||
- | </code|x> | + | </ |
==== Step 3 ==== | ==== Step 3 ==== | ||
Modify a line in the code, change the path to the directory where your combined file will go. Do not choose the same directory as the where the csv files reside. | Modify a line in the code, change the path to the directory where your combined file will go. Do not choose the same directory as the where the csv files reside. | ||
- | <code|x> | + | < |
Set objFile = fso.CreateTextFile(" | Set objFile = fso.CreateTextFile(" | ||
- | </code|x> | + | </ |
==== Step 4 ==== | ==== Step 4 ==== | ||
Run the macro in Excel. A message box saying " | Run the macro in Excel. A message box saying " | ||
data_load_problem_how_to_join_many_csv_files_together.txt · Last modified: 2008/09/12 09:49 (16 years ago) by cliff