LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting numbers in text file

Solved!
Go to solution

Hi, I have got an task to make read a file and get the total number of numbers.

example: input file with numbers: 1000 2 33 555 in file, output: 4

                input file with numbers: 2 4 6                        , output: 3

 

 

0 Kudos
Message 1 of 3
(920 Views)
Solution
Accepted by topic author Doksavit

r approach depends on how the file can be defined. Can you get input that would look like this: "1234 12a34"? Would something like this be considered to contain 3 numbers? for me, I would use a regular expression to pick out numbers and simply count the times you get a match.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 3
(894 Views)

I know that Mark's answer is the solution but I don't know if this could help anyone. I remember someone gave me a VI that placed anything that was a number in an array and you simply count the elements via the output. This could be integers, doubles, or singles.

0 Kudos
Message 3 of 3
(823 Views)