+ Post New Thread
Results 1 to 9 of 9
How do you do....it? Thread, merging 2 text files in Technical; Im trying to do something and I cant think of the easiest way to do it. I have a config ...
  1. #1

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,510
    Thank Post
    1,319
    Thanked 469 Times in 306 Posts
    Blog Entries
    6
    Rep Power
    199

    merging 2 text files

    Im trying to do something and I cant think of the easiest way to do it.

    I have a config file for something, and it is about 20,000 lines long.

    The new version of the software adds about 300 lines of new options at various parts in the file. The new config has the default settings in it.

    Without going through the new one and changing each part manually, is there any way I can merge my existing config with the new one, while keeping the new added options intact?

    I really dont want to have to edit ~ 10,000 lines again.

    I had a look at ultracompare, and it finds the lines that are different, and the most of them match up, but it doesnt seem to replace lines from one to the other ?

  2. #2

    Join Date
    Feb 2006
    Location
    Derbyshire
    Posts
    1,381
    Thank Post
    181
    Thanked 211 Times in 171 Posts
    Rep Power
    65

  3. Thanks to OutToLunch from:

    RabbieBurns (29th June 2008)

  4. #3
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    467
    Thank Post
    14
    Thanked 50 Times in 48 Posts
    Rep Power
    23
    I suggest cat - native in unix or Native Win32 ports of some GNU utilities

    You should be able to do it with redirect in batch, but I'm not 100% sure of the syntax.

    Cheers
    Jona

  5. #4


    Join Date
    Jan 2006
    Posts
    8,202
    Thank Post
    442
    Thanked 1,032 Times in 812 Posts
    Rep Power
    339
    have a look at meld
    Meld : Home Page

  6. #5
    Scotmk's Avatar
    Join Date
    May 2007
    Location
    Milton Keynes
    Posts
    277
    Thank Post
    1
    Thanked 4 Times in 3 Posts
    Rep Power
    16
    If its just lists (everything on its own line) you can use good ole fashion DOS.

    copy 1.txt + 2.txt 3.txt

    will append 1.txt to 2.txt in a file called 3.txt.



    Just have to ensure theres a carraige return on end of each line I think, its been a while.

  7. #6
    Scotmk's Avatar
    Join Date
    May 2007
    Location
    Milton Keynes
    Posts
    277
    Thank Post
    1
    Thanked 4 Times in 3 Posts
    Rep Power
    16
    ok, I read post again, this wont work for replacing change characters, but still, handy.


  8. #7

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,236
    Thank Post
    1,057
    Thanked 1,067 Times in 624 Posts
    Rep Power
    740
    Quote Originally Posted by Scotmk View Post
    If its just lists (everything on its own line) you can use good ole fashion DOS.

    copy 1.txt + 2.txt 3.txt

    will append 1.txt to 2.txt in a file called 3.txt.



    Just have to ensure theres a carraige return on end of each line I think, its been a while.
    Also there is a compare in DOS too. [ Comp ]
    Like Scotmk, have not had to use that for a long time.....Arrrrr the memories

  9. #8

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,510
    Thank Post
    1,319
    Thanked 469 Times in 306 Posts
    Blog Entries
    6
    Rep Power
    199
    I dont want to append files on the end of other files, I want to take lines out of 1 file, and put them into the new file.

    for example the old file looks like this

    Code:
    1. Section1:
    2.
    3. Name=Blah
    4. Colour=blue
    5. Size=10
    6. Font=Times
    7. Exist=Yes
    8. Blah=1
    9. Blab=2
    but the new file looks like this

    Code:
    1. Section1:
    2. 
    3. Name=Crah
    4. Colour=green
    5. Size=15
    6. Newsetting=1
    7. Font=Comic
    8. Exist=No
    9. Blah=2
    10. Blab=4
    So I want to get my old settings accross to the new config file, but allowing for the new additions which are in the new config file.

    I had a quick look at Winmerge at lunch there, will have a look at Meld after work. Cheers.

  10. #9

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,510
    Thank Post
    1,319
    Thanked 469 Times in 306 Posts
    Blog Entries
    6
    Rep Power
    199
    Managed to get it sorted with winmerge. Took many hours in the end but the end result is worth it (new skin for my eva8000)

    Thanks for the heads up on winmerge OutToLunch

SHARE:
+ Post New Thread

Similar Threads

  1. Merging Moodle courses
    By andy in forum Virtual Learning Platforms
    Replies: 1
    Last Post: 12th March 2008, 07:00 PM
  2. Merging 3 schools networks
    By ryan_powell in forum Wireless Networks
    Replies: 8
    Last Post: 6th February 2008, 08:46 AM
  3. Mail Merging
    By bensewell in forum MIS Systems
    Replies: 1
    Last Post: 12th October 2007, 02:23 PM
  4. urgent pls help on merging the network together
    By d1551 in forum Wireless Networks
    Replies: 6
    Last Post: 9th January 2007, 09:11 AM
  5. Locate and edit text files
    By _Bob_ in forum Scripts
    Replies: 14
    Last Post: 7th June 2006, 02:11 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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