[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Combine 400 file

Posted on 2013-01-15
3
Medium Priority
?
402 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 300 total points
ID: 38780637
0
 
LVL 71

Accepted Solution

by:
Qlemo earned 1700 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
MS Outlook undoubtedly is the most widely used email client.Its user-friendliness, cost effectiveness, and availability with Microsoft Office Suite make it the most popular email application.  Its compatibility with Microsoft applications like Exch…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

830 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