Solved

Combine 400 file

Posted on 2013-01-15
3
371 Views
Last Modified: 2013-01-15
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
0
Comment
Question by:Rayne
3 Comments
 
LVL 31

Assisted Solution

by:James Murrell
James Murrell earned 75 total points
ID: 38780637
0
 
LVL 69

Accepted Solution

by:
Qlemo earned 425 total points
ID: 38780663
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
 

Author Closing Comment

by:Rayne
ID: 38781231
Thank you Guys for the Help :)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
I have a large data set and a SSIS package. How can I load this file in multi threading?
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question