Message 1 of 12
Help to improve performance when reading large files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Back again... I am reading an XML file which is 15,000+ lines (~280MB) where I need to check lines for keywords and collect its data. Currently it's taking ~8 minutes to read this file which I am hoping to reduce this to anything less. Any ideas would be greatly appreciated!
Here is an example of how my script looks
Here is an example of how my script looks
(
local my_file = "c:\\my_file.xml"
local my_fileOpen = undefined
local my_fileRead = undefined
local my_array = #()
-- open file
my_fileOpen = openFile my_file
-- read file (line-by-line)
while not eof my_fileOpen do
(
my_fileRead = readLine my_fileOpen
if (matchPattern my_fileRead pattern:"*<node>*") then append my_array my_fileRead
)
-- close file
close my_fileOpen
print my_array
)