473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

fastest method to load text file

what is the fastest method to sort and load 1 lakh + strings in a list box
from a text file. each string is in a new line
--
Gaurav Creations
Nov 21 '05 #1
5 2824
Gaurav,
what is the fastest method to sort and load


It is not possible to sort a standard textfile at least there has to be
something what can be the sortkey.

Cor
Nov 21 '05 #2
the listbox does sort the strings while inserting if sort is set to true

"Cor Ligthert" wrote:
Gaurav,
what is the fastest method to sort and load


It is not possible to sort a standard textfile at least there has to be
something what can be the sortkey.

Cor

Nov 21 '05 #3
the listbox does sort the strings while inserting if sort is set to true

"Cor Ligthert" wrote:
Gaurav,
what is the fastest method to sort and load


It is not possible to sort a standard textfile at least there has to be
something what can be the sortkey.

Cor

Nov 21 '05 #4
"Cor Ligthert" <no************@planet.nl> schrieb:
what is the fastest method to sort and load


It is not possible to sort a standard textfile at least there has to be
something what can be the sortkey.


Huh?

You can sort the lines alphabetically:

\\\
Dim sr As New StreamReader("C:\WINDOWS\win.ini")
Dim Lines() As String = Split(sr.ReadToEnd, ControlChars.NewLine)
sr.Close()
Array.Sort(Lines)
For Each Line As String In Lines
Debug.WriteLine(Line)
Next Line
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 21 '05 #5
Herfried,

I tried your code with a little change, what is the sense of this result.

///
\\\
Array.Sort(Lines)
Dim Lines() As String = Split(sr.ReadToEnd, ControlChars.NewLine)
Dim sr As New StreamReader("C:\Test\Herfrieds.txt")
For Each Line As String In Lines
M V P <URL:http://dotnet.mvps.org/>
Next Line
sr.Close()
You can sort the lines alphabetically:

Please, read my message again

Cor
Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: chad kline | last post by:
i have searched around for an answer to this question, but haven't found a satisfactory answer. i understand things like mmap(2) can be used to quickly load a file - but it seems to be a...
11
by: Ignacio X. Domínguez | last post by:
Hi. I'm developing a desktop application that needs to store some data in a local file. Let's say for example that I want to have an address book with names and phone numbers in a file. I would...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
7
by: Doru Roman | last post by:
Hi, What is the fastest way to evaluate manually the result in this case: int a, b, c; a = 255; b = 122; c = a & b; The only way I know is transforming each number into the binary value...
3
by: _DD | last post by:
I had one experimented with binary serialization of an ArrayList of structs (each struct mostly contains strings). Strangely enough, it did not run as fast as custom XML storage (latter was...
5
by: beersa | last post by:
Hi All, I have to query the database with the string from text file. Here are the details: OS: WinXP Home Pro DB: Oracle 9.x The table in DB has 20,000 rows. The text file has 15,000...
1
by: Abrahams, Max | last post by:
I've looked into pickle, dump, load, save, readlines(), etc. Which is the best method? Fastest? My lists tend to be around a thousand to a million items. Binary and text files are both okay,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.