LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read large txt file (via Configuration Files) takes too much time

Solved!
Go to solution

hi there,

i want to read large txt files (about 1-8mb) into memory.

the structure of the txt file looks like this:

 

[0]
Shape = "Point"
Grid size [nm] = 100,000000
Pixel Dose [pC] = 0,100000
Colour = 0
X = 38,169451
Y = 10,102625

 

and for example a 1mb txt file contains about 8000 of these points.

 

with the current code iam using it takes ages until the txt file is loaded:

 

code.png

 

any idea how to make the code faster?

many thanks in advance! 🙂

0 Kudos
Message 1 of 2
(2,688 Views)
Solution
Accepted by topic author re-fuse

The NI configuration files is notorious for being slow.  It usually isn't noticable because you normally just read small amounts of data but as soon as it is large structures it is very noticable.  OpenG has an INI config palette that lets you read or write anything but the low level is these NI VIs and it shows because it can be very slow.

 

The solution is to not use these configuration VIs.  Instead I'd highly recommend the MGI Read/Write Anything.  MGI wrote the string parsing from scratch and as a result it is super fast.  You can install MGI tools using VI Package Manager.

Message 2 of 2
(2,664 Views)