I have a large (to me at least) up to 20Mb text file to search through for several differing patterns of data.
it is a file of data generated by one of my Amateur Radio programs and it includes callsign and location (public QRA data published by the user with the expectation it is used by anyone to determine an approximate location).
This file is updated every 60 seconds and is intended by the app to be parsed by third parties to add features to the application use.
I am using Split(x,x) which works ok and surprized me how quickly it can split a 10Mb file into an array of 15 elements following an EndOfLine.
But I had thought it might be simple to add to the Split(x,x) a secondary hack or two to tweak it to remove more of the unwanted stuff in a single pass.
The question is, what is the raw code for Split(x,x) or anything that anyone has which has a similar function, or is there different way to remove expected data from a string of data that is not a built in Xojo method and will at least not be any slower than Xojo inbuilt stuff might be.
I am not wanting super speed like less than 100ms to parse out all the stuff I want, but I might like to keep it below 10 seconds on its first pass at boot up, subsequent passes will use the time stamp generated by the file (at 1 minute intervals) to work on only a very tiny amount of data, maybe 2k each time.
Guess it depends on what it is you need to do
Replace and ReplaceAll can be useful - but on huge strings they take in one, process it and produce another so at one point you have the “old” data and “new” data in memory at the same time
That may, or may not, be an issue
I was going to mention RegEx.Replace and then I remembered how I hate Regex LOL. I will be working on unpdating an app I worked on some years ago and I need to work with some large .edi files, I re-read the RegEx docs and decided I’m keeping my Split() solution
Thanks both,
still to get to test replace, if the empty string removes rather than replace with an empty string it will work fine.
I also forgot to mention regex is not something I want to spend time learning, it seems to the uninitiated (me) like linux command line without any of the charm or well written instructions that linux has.
I am glad Hector that I am not the only person to want to persevere with the less complicated inbuilt functions!
BUT we are both fools to dismiss the absolute power of RegEx, I know I just can not be bothered to study it, my bad for sure.
I guess I’ll watch the series on RegEx a couple of times, read about it and then practice practice practice. Perhaps I’ll even manage to not hate it in the future.
to get back to one of the original questions, is there any code in Xojo than anyone has that mimics the Split(x,x) function.
I wonder how this function, or others such as Left, Right etc are formulated, is it a C function of some sort or what? (forgive my utter ignorance of how my random typing in the IDE ends up as an application)