Solved

Combine 400 file

Posted on 2013-01-15
3
347 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
Comment Utility
0
 
LVL 68

Accepted Solution

by:
Qlemo earned 425 total points
Comment Utility
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
Comment Utility
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.

Join & Write a Comment

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 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

Need Help in Real-Time?

Connect with top rated Experts

5 Experts available now in Live!

Get 1:1 Help Now