LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help Reading Text Configuration File

Solved!
Go to solution

Need some help...

 

I'm trying to make a VI that'll read a simple text configuration file.  The file will have entries like:

 

URL = 192.168.0.1

Port = 9000

 

What I'd like to do is to read in the line, and  'parse' it into 2 strings.  Then, based on the contents of the first string (the part before the = sign), do something with the second part (after the =).

I've managed to open the file using 'Open/Create/Replace File' and but am having problems reading  'Scan From File' to pull in the strings (it seems set an error when I read in the first line although my probes show that I got both strings).

Anyway, once I've got my 2 strings, is there a simple 'case' like strucure that I can use to search through all my pre-defined 'first strings'? 

0 Kudos
Message 1 of 4
(2,139 Views)
Solution
Accepted by topic author Steve257

You don't have to build anything new. Just use the Config File VIs - check under the File IO functions. They will do exactly what you want.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 4
(2,127 Views)

Smiley Very Happy Great!  I was hoping that I wouldn't have to re-invent the wheel!

Thanks.

0 Kudos
Message 3 of 4
(2,108 Views)
Right on Mike!! The Config File VIs are very useful. You might still need to do some string manipulation afterwards but that's up to what you're wanting to do. Remember: If someone answers your question fully in a forum, please...please...please set it to the "answer" so future forum-perusers will have an easier time finding solutions. Thanks and Happy Wiring!!
0 Kudos
Message 4 of 4
(2,097 Views)