Merge multiple files

If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
21 posts Page 1 of 3
Contributors
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Merge multiple files
clanc789
Hey coders,

For school I've to create a huge dictionary (why would they let students do that...) and I've got a couple of problems. Several files are have a really big amount of words (17 million), each word is on a line resulting in 17 million lines. I need all these lines to be in 1 big file named all.txt. So far copy+paste works fine, but for those big files my notepad++ crashes (c++ runtime error, unexpected). Anybody got an idea which program to use to be able to open these? It'd really help me out.

Kind regards,
Max
Practice makes perfect!

VIP since: 6-10-2011
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Merge multiple files
comathi
Does it matter in which order words are merged in the file?
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Re: Merge multiple files
clanc789
No, as long as there is only 1 word per line. Alphabetical order does not matter at all.
Practice makes perfect!

VIP since: 6-10-2011
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Merge multiple files
comathi
If you're looking into writing a small application to ease your task, try this:

http://www.codeproject.com/Questions/40 ... -in-VB-NET

Using a StreamReader would enable you to read very large files... Just read it line by line and write it in your destination file cooll;
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Re: Merge multiple files
clanc789
comathi wrote:
If you're looking into writing a small application to ease your task, try this:

http://www.codeproject.com/Questions/40 ... -in-VB-NET

Using a StreamReader would enable you to read very large files... Just read it line by line and write it in your destination file cooll;
Will try after lunch, a big thanks already for the effort :D
Practice makes perfect!

VIP since: 6-10-2011
User avatar
comathi
Coding God
Coding God
Posts: 1242
Joined: Fri Mar 26, 2010 1:59 pm

Re: Merge multiple files
comathi
No problem... I'd write something for you, but I'm on my laptop at the moment... Later on in the day I could try something if you still don't have it working :)
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Re: Merge multiple files
clanc789
Hey Comathi,

The link you posted does not really make sense to me (in terms of: I dont understand it really). If you could help me with that, that'd be great :D

EDIT: I've got a file that has 8 million lines and one of 14 million lines and I need to add these together. I dont know if you need the numbers exactly?
Practice makes perfect!

VIP since: 6-10-2011
User avatar
Shim
VIP - Donator
VIP - Donator
Posts: 882
Joined: Wed Dec 14, 2011 5:02 am

Re: Merge multiple files
Shim
I think it would be easier if you do that with xml instead of txt
Find my programs on Softpedia
Filip
Coding Guru
Coding Guru
Posts: 833
Joined: Wed Jan 05, 2011 3:59 pm

Re: Merge multiple files
Filip
mshimranpro wrote:
I think it would be easier if you do that with xml instead of txt
xml is in plain text format. I would rather use MySQL.
CodenStuff wrote:
Nope, it's just your sick and dirty mind. You sick twisted warped little pervo :D
User avatar
clanc789
Coding Guru
Coding Guru
Posts: 786
Joined: Tue Nov 02, 2010 4:45 pm

Re: Merge multiple files
clanc789
Why not plain text? There is no need for security or anything. You guys made me curious now :)
Practice makes perfect!

VIP since: 6-10-2011
21 posts Page 1 of 3
Return to “Coding Help & Support”