Combine 400 file

Hello

I wanted to know the quickest way to to do this?

Combine 400 csv files to one csv file?

How to do quickest - for DB upload...

thnkas
RayneAsked:
Who is Participating?
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
DOS method - has superfluous header info for each file, so would need to delete that after importing into DB:
@echo off
for %%F in (C:\Folder\*.csv) do copy /b c:\temp\result.csv+%%F

Open in new window

PowerShell method - header info is written once:
get-childitem C:\Folder\*.csv | foreach-object { import-csv $_.FullName ] | export-csv c:\temp\result.csv -NoTypeInfo

Open in new window

Using VBScript with FileSystemObject is another approach, and there are many more.

But probably importing csv files one by one might be better performance-wise. Having to write a big file out of 400 smaller needs a lot of additional I/O.
0
 
James MurrellConnect With a Mentor Product SpecialistCommented:
0
 
RayneAuthor Commented:
Thank you Guys for the Help :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.