Results 1 to 3 of 3

Thread: Code to merge multiple files into One

  1. #1
    Join Date
    Feb 2009
    Posts
    39

    Code to merge multiple files into One

    I have a database, in which there are multiple CSV files, and I wanted to join them and converted into a single CSV file for that I wanted to have a coding samples, is it possible with the coding to merge multiple CSV files.I know this is possible,but i am confused how to do that.

    please help!!

  2. #2
    Join Date
    Dec 2008
    Posts
    31

    Re: Code to merge multiple files into One

    if you know the order of the files, there is one method to do that.

    String e = "";
    e += [file part 1 data]
    e += [file part 2 data]
    e += [file part 3 data]
    e += [file part 4 data]
    ...
    e += [file part 1029323 data]

    String fileName = "data.txt"
    [save the e string onto fileName]

    That's pretty abstract but it's not too difficult.
    Try Scanner class for reading a file... Or buffer redreader

  3. #3
    Join Date
    Jan 2009
    Posts
    41

    Re: Code to merge multiple files into One

    I also had the code for merging the multiple file into one but it is very lengthy and quite messy therefore i search for code on the internet and i found this:

    Code:
    Sub AppendFiles1()
    
          Dim Temp As String
    
          Open "File2.CSV" For Append As DestNum
    
          Open "File1.CSV" For Input As SourceNum
    
    Do While Not EOF(SourceNum)
             Line Input #SourceNum, Temp
             Print #DestNum, Temp
          Loop
    
    CloseFiles:
    Close #DestNum
          Close #SourceNum
          Exit Sub
    
    ErrHandler:
    
          MsgBox "Error # " & Err & ": " & Error(Err)
          Resume CloseFiles
    
       End Sub
    This code will allow you to pick the multiple CSV files. Is there a way to do that with tech code you provided?

Similar Threads

  1. How to Merge multiple FLV files
    By Viraana in forum Windows Software
    Replies: 3
    Last Post: 26-11-2010, 07:58 PM
  2. Merge multiple files with different extensions
    By Orton in forum Tips & Tweaks
    Replies: 2
    Last Post: 27-07-2010, 05:48 AM
  3. How to merge multiple files in MS Publisher
    By aneesh in forum Windows Software
    Replies: 1
    Last Post: 01-05-2009, 10:55 AM
  4. Merge multiple iTunes libraries
    By Holt in forum Windows Software
    Replies: 4
    Last Post: 31-03-2009, 03:34 PM
  5. Merge multiple PDF files in single PDF file
    By Steinbach in forum Tips & Tweaks
    Replies: 2
    Last Post: 19-03-2009, 11:20 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,651,302.85135 seconds with 17 queries