04-20-2011 09:51 AM
I was wondering if someone could help here. I have to read from a file line by line such that each time the word FAIL is found,
output each listed character follow by a tab and the corresponding number. For each missing character here give it the value found after FAIL.
for example from the attached file: in the first line I have FAIL 100 so I will output:
e 102
i 699
o 717
and I have to add the missing character of the alphabet that are not here and give them the value after FAIL
so, I will have
e 102
i 699
o 717
a 100
b 100
c 100
d 100
f 100
g 100
h 100
j 100
k 100
l 100
.
.
.
.
04-20-2011 10:53 AM
Is this what you need? You didn't specify what the output should be, so I assumed an array would be fine.
Note how this works. It uses regular expressions, which are pretty powerful. I look for the FAIL line with the first Match Regular Expression, and then I take everything after that match. Next, I look for the next FAIL line, and I take everything before that match. That gives the letters and numbers after the first FAIL line.
Then, wash, rinse and repeat as neeeded. Oh, well, skip the wash and rinse part, just repeat until the second one gives -1 for offset past match!
04-20-2011 11:38 AM
Not really, But good indication. I need something like this but all the missing characters of the alphabet should also be listed and should have the value of the number after FAIL.
So in this case, let consider spot 1 of this output array, we have
e 102
i 699
o 717
but the rest of the alphabet is missing, a, b, c, d,f,g, h, j... are missing. And because they are not listed on the original list so I have to give them the value of FAIL ( the number coming after FAIL, which is 100 for this spot
so,
I will give them the value of 100
spot 1 will look like this:
e 102
i 699
o 717
a 100
b 100
c 100
d 100
f 100
g 100
.
.
.
spot2 will look like this:
c 103
f 674
t 512
a 147
b 147
d 147
e 147
.
.
.
Thanks for your help.
04-20-2011 12:00 PM
That should be simple for you to add. Use the "whole match" output of the first Regular Expression primitive and wire that into the "input string" of a third Regular Expression primitive with the regular expression rule "Face [0-9]+ FAIL ". The "after match" of the third Regular Expression will be the number (error code?) you are interested in.
Then, write a little code to find out which letters you are missing in each iteration of the loop. Concatenate those missing letters with the number from the third Regular Expression primitive above. Concatenate that string with what is in each array element now and you'll have what you are looking for.
04-20-2011 12:16 PM
Easy to say but seems to take me a lot of time.
I don't get this ..."and wire that into the "input string" of a third Regular Expression primitive with the regular expression rule "Face [0-9]+ FAIL " . Can you clarify a bit?
04-20-2011 12:31 PM
Oh, sorry about that!! I expanded on the original VI that I sent to you, but I didn't post it.
This VI gets you what was originally posted, plus the "third Regular Expression primitive" that gets the error code for the rest of the alphabet.
I attached the VI that gets the error code for the rest of the alphabet and a loop that finds what letters you have, so you know which ones you have to get. I bet you can get the rest of the alphabet and concatenate it with the error code that isn't in each array element
04-20-2011 01:03 PM
Thanks, I will trying.
04-20-2011 01:05 PM
Good. Give it a try and if you get stuck I'll give you some hints!
04-20-2011 01:24 PM
I definetly need some help here to get this done as we need it today. This is what I am trying but IAM REALLY STACK.
More help will help.
04-20-2011 01:35 PM
I have LV2009, can you save for that?