Hi All
I have a large series of strings, 750,000 of them and I need to search these for a single string.
They are downloaded from the internet.
What is the quickest method to carry out a search? Either put them all in a database then search or use lists or maps.
Regards
CD
Search for string Advice?
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Search for string Advice?
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Search for string Advice?
How are your data stored on the server ?They are downloaded from the internet.
The data received is formatted? JSON ?
Do you have a loop to receive data in your code?
➽ Windows 11 64-bit - PB 6.0 x64 - AMD Ryzen 7 - NVIDIA GeForce GTX 1650 Ti
Sorry for my bad english and the Dunning–Kruger effect.
Re: Search for string Advice?
What kind of search ?
An exact match of the entire string, a substring search, case (in)sensitive ?
Do you always need to search for the same string ?
An exact match of the entire string, a substring search, case (in)sensitive ?
Do you always need to search for the same string ?
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
-
- Addict
- Posts: 1309
- Joined: Fri Aug 28, 2015 6:10 pm
- Location: Portugal
Re: Search for string Advice?
Hi
The strings come from several different places with no defined format they may also contain unicode characters.
I have a loop that reads all the strings from the various locations working no bother. My problem is that when a new string is entered or downloaded I have to check all the strings for an exact match, whitespace can be thrown away.
CD
The strings come from several different places with no defined format they may also contain unicode characters.
I have a loop that reads all the strings from the various locations working no bother. My problem is that when a new string is entered or downloaded I have to check all the strings for an exact match, whitespace can be thrown away.
CD
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Re: Search for string Advice?
If your only goal is to built a list of strings without adding duplicates, the easiest way is to use AddMapElement. The default behaviour is already to avoid duplicate keys so you wouldn’t need a search. This should also be pretty fast.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)