#125689 - 2004-08-26 09:07 AM
Re: Listing textfile
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Approximately how many unique lines in total will there be?
If it's no more than (say) 10,000 you can load each line into an array. Search the array for the string, if it's not present add it and write to your new file otherwise ignore it.
You can do exactly the same thing with ReadProfileString() and WriteProfileString(), and these are usually easier for starters to understand.
If you have a lot of uniques you may get into memory trouble with arrays.
In this case:
- Catenate all the files together using DOS COPY (the "+" switch)
- User DOS SORT to sort the catenated file.
- Read each line in your sorted file. If it is the same as the last line ignore it, otherwise write it to your new file.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|