08-26-2009 01:01 PM
HI is any suggestion or any site on parsing tex files.
Im just trying to parse
CHILLER 22
08-26-2009 01:09 PM
For reading text files I usually use the regular expression functions in CVI.
You can use RE's to search the text file for items of interest. The NI RE implementation is not particularly good - it won't parse past a linefeed as I recall.
You may be able to find an RE library in C on the web that does a better job than CVI.
Menchar
08-26-2009 01:20 PM
What are RE's?
08-26-2009 01:29 PM
08-26-2009 01:48 PM
is there an example in cvi to loop at , where in the are are opening text files and parsing them.
or if you have an example can you send it to me.
i just need some where to start.
08-26-2009 02:01 PM - edited 08-26-2009 02:06 PM
If your parsing needs are that simple, you can just use the ANSI C sscanf() function. sscanf() returns the number of items found, so you can use that return value for a simple error check.
char command[256];
int parameter, items;
char cmd_line[] = "CHILLER 22"; // real program will get this string from somewhere else
// read the command, expecting 2 items
items = sscanf(cmd_line, "%s%d", command, ¶meter);
if (items != 2)
printf("Syntax error in line %s\n", cmd_line);
Your last question on reading from a file is starting to duplicate your post here: http://forums.ni.com/ni/board/message?board.id=180&message.id=42661&jump=true
08-26-2009 07:01 PM
08-27-2009 02:41 AM
08-27-2009 02:59 AM
08-27-2009 03:10 AM
ok i got the program to work, where it will interpret the text file. now my question is how can i get the that text file associate with the ini file.
because what is going to happen i have program that has a gui and it speaks to a device. what i want to do is have that text file lauching the same gui i have.
because the engineer wants to be able to edit the temperature from the text file. so how can i make that happen. what will be my starting point.
im going to post my project soyou can see what im talking about