10-09-2013 09:40 PM
hi,
im using labview 12.0.im still new using labview. i want to extract a type of same information from text file using match pattern. but it could not give out any result.at first im using data string directly from output of system exec.vi and it run just nice in term of extracting the information that i want. but when i try using read from text file string, it could not give out any output.is it because they have different type of string?the text and result read correctly from text file.
Solved! Go to Solution.
10-09-2013 09:47 PM
Can you post your VI. There's something cannot be checked from screenshot. Attach text file also.
10-10-2013 01:08 AM
this r the vi and text file..
10-10-2013 01:16 AM
Right-click the read function and uncheck "convert EOL". See if this solves your problem.
10-10-2013 01:53 AM
10-10-2013 02:11 AM - edited 10-10-2013 02:14 AM
@ouadji wrote:
or use \n in place of \r
This is a pure Rube Goldberg suggestion!
The rught way is to read the file verbatim as I suggested.
Doing a OS specific EOL conversion followed by a bandaid adjustement to undo it nanoseconds later is not guaranteed to be OS independent, and could blow up on a different OS. Very bad idea leading to fragile code!
10-10-2013 03:19 AM
"The right way is to read the file verbatim as I suggested."
I never said that your solution was not the best.
Mine is just an alternative for this Specific case, nothing else.
"This is a pure Rube Goldberg suggestion!"
unhelpful and meaningless comment.
10-10-2013 03:33 AM
if i want to view in a string with 2 digit number. is it possible to put 0 in front of the 1 digit number as a fixed and for 2 digit just remain as it is?
eg: '2'='02'
'25'='25'
10-10-2013 06:55 AM
Hi
Use the %02d to fill excess characters with 0
Mike
10-10-2013 08:07 AM - edited 10-10-2013 08:13 AM
Almost, but not quite. The dot matches any character (except a newline).
For something like MAC addresses, your regex would be
(\w{1,2}-){5}\w{1,2}
That would omit strings with spaces and most punctuation, although strictly, this admits underscores but that one exception would be quite unlikely in this long a pattern.
Cameron