Results 1 to 4 of 4

Thread: Merge two text files into one

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    Merge two text files into one

    For processing reason, I need to split big text file into two files. One is from column 1 to 200 and another is from 201 to 1500.

    How to code to merge these two files into one text file, that is one file must be column from 1 to 1500?

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,715

    Re: Merge two text files into one

    You are talking about columns, why not have the file as a database rather than a text file?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Merge two text files into one

    You could perform a IO.File.ReadAllLines() call on both files, and then assuming they are the same number of actual lines (rows) because they came from the same file originally, you could loop through and recombine them for output. You would have to test to see how performance is.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2010
    Posts
    478

    Re: Merge two text files into one

    In fact, these two text files are using vedit to translate from ebcdic file. (2G)
    First, I use vedit to split two ebcdic files and then translate into two text files.
    In order to insert into SQL, I need to merge them again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width