Regex.Split

omoba

Active Member
Licensed User
Longtime User
Hi,

I am doing regex.split on a couple of text files. When I split a small file it is quick to split but when I try to split bigger text files it takes forever to split.
Note these big files would load to a label box in about 2 secs if I dont split.
Is there some wrong with the way I am splitting or is there anything I can do to speed things up?


Sub myText
info= Regex.Split(" ", txt)

For k = y To arrWord.Length - 1
Log(info(k) & " " & info(k).Length)
CCT.AddLinkText(lblText,arrWord(k).Trim & " ",Colors.black,"GetString")
Next

End Sub


Thanks
 

mangojack

Expert
Licensed User
Longtime User
Just as a reference , on a virtual device (1280x800 pad) its taking 4 seconds to Regex a 1200 word textfile, is this quicker/slower that your split.
How large is your text files approx... How long is forever ?

Cheers mj
 
Upvote 0

omoba

Active Member
Licensed User
Longtime User
The file is 101KB and I running it on an actual device.

Just tried splitting again and 10mins and counting no display
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
yeah .. 1200 word text file = 8kb for 4 seconds. just ran a 120kb of similar text for 12 minute result.
Above and beyond me. Maybe offer a free coffee with every app sold.
Hope you can resolve the issue.


Just did a copernic and it seems to be a common problem with large files.. Thinking as i was reading .. could you breakup the files ??

maybe have a read ..
http://bytes.com/topic/java/answers/17999-regex-whole-large-text-file

Cheers mj
 
Last edited:
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
What is your populated list about? A workaround is to partially read your file, regex.splitting each separated line and adding the results to your list.
 
Upvote 0
Top