To create a VI which removes all numbers from a string and counts them in LabVIEW - labview

I need to create a VI which removes all numbers from a string and counts them in LabVIEW.
For example, if there's a string "12Anna33" this VI has to transform it into "Anna" and to count the amount of numbers in the string - 4.
How can I do this in LabVIEW?

Here is fixed solution from #Vignesh, which takes into account zeroes + uses conditional terminal for For Loop output:
But, #sweber referred to even easier solution from another thread:

As both previous answers given in the comment doesn't have count feature, this will suit your requirement perfectly.
Drag and drop this Vi Snip to LabVIEW 2017 or Above

Related

Pentaho - Spoon Decimal from Text File Input

I'm new to Pentaho and have a little problem with the Text file Input.
Currently I have to have several data records written to a database. In the files, the decimal numbers are separated by a point.
Pentaho is currently transforming the number 123.3659 € to 12.33 €.
Can someone help?
When you read the file, do you read it as a csv, excel or something like that? If that's the case, then you can specify the format of the column to interpret the number correctly (I think, I'm talking from memory now) Or maybe playing with the language of the file might work.
If it's a file containing a string, you can use some step like the string operator to replace the point with a comma.
This problem might come from various reasons.
Although I think that by following the next steps you can solve the issue.
-First, you must get a "Replace in String" step;
-Then search for the dot and replace it with nothing as I show in the following image, or with a coma if the number you show is a float;
Example snip
Hope this helped!
Give feedback if so!
Have a good day!

How to get the part of a string after the last occurrence of certain character?

I would like to have the substring after the last occurrence of a certin character.
Now I found here how to get the first, second or so parts, but I need only the last part.
The input data is a list of file directories:
c:\dir\subdir\subdir\file.txt
c:\dir\subdir\subdir\file2.dat
c:\dir\subdir\file3.png
c:\dir\subdir\subdir\subdir\file4.txt
Unfortunately this is the data I have to work it, otherwise I could list it using command prompt.
The problem is that the number of the directories are always changing.
My code based on the previous link is:
select (regexp_split_to_array(BTRIM(path),'\\'))[1] from myschema.mytable
So far I've tried some things in the brackets that came in to my mind. For example [end], [-1] etc.
Non of them are working. Is there a way to get the last part without rearranging my strings backwards, and getting the first part, then turning it back?
You can use regexp_matches():
select (regexp_matches(path, '[^\\]+$'))[1]
Here is a db<>fiddle.

How would I create a function in objective-c that would correctly output the results of in mathematical precedence?

I want to create a mathematical calculator in objective-C. I need it to run
through a command line. The user will enter an equation like 4 + 2 * 12 etc. The output should calculate the 2 and 12 first because they are times by. How would I create a command line program that creates output based on mathematical order or precedence. for example solving whats in the brackets first then anything that is multiplied and or divided by etc etc.
there are multiple programs available online for this here is just one http://www.wikihow.com/Make-a-Command-Prompt-Calculator, in the CMD line you can specify precedence by simply using parenthesis like the following C:> set /a ((2*12)+4) obviously replacing hard coded values with that passed to a variable.

Making chunks of audio files using SoX if start and end times are known

I have a 10 minute audio which I want to break in chunks of time as follows:
(the format is mm:ss.frac)
1. 1.wav -> 00.000 - 20.271
2. 2.wav -> 20.272 - 47.550
3. 3.wav -> 47.551 - 01:20.562
I tried using the trim command like such
sox infile outfile trim 0.000 20.271 However the format is trim start [length]
Worst case, I will have to calculate the durations for individual chunks. Is there another way?
I found that the simplest solution is to write the command as such:
sox infile outfile start =end
The audio is not sent to the output stream until the start location is reached and specifying an end location can be done by using the "=" sign with the end time.
So the code would now be, for instance:
sox forth.wav 10.wav trim 303.463 =353.790
Link to the docs http://manpages.ubuntu.com/manpages/precise/man1/sox.1.html
Relevant excerpt:
trim start [length|=end]
The optional length parameter gives the length of audio to
output after the start sample and is thus used to trim off the
end of the audio. Alternatively, an absolute end location can
be given by preceding it with an equals sign. Using a value of
0 for the start parameter will allow trimming off the end only.
No, you have to calculate the length if you want to use sox. You could also use ffmpeg instead which has atrim filter that supports start/end times.

SQL cannot search

In my SQL table Image, when i perform a search query
SELECT * FROM Image WHERE platename LIKE 'WDD 666'
it return no result(using other column to search then no problem).
The all the column data was inserted by C# code. (If enter data manually search works.)
now i suspect that the words WDD 666 wasn't english alphabet. is this possible?
In c#,
the plate number was generate by using tesseract wrapper string type.
what should i do to search the plate number?
Thanks in advance and sorry for my bad English.
Since your case matches, I'm going to rule out Case-sensitivity.
There may be leading or trailing blank spaces - Try this..
SELECT * FROM Image WHERE platename LIKE '%WDD 666%'
Try running this command:
SELECT '*'+plateName+'*',len(plateName)
FROM image.
I suspect platename has some non-printable characters in the field.
It appears to be a CR/LF at the end of the data. You can use
UPDATE image SET plateName = replace(plateName,char(13)+char(10),'')
WHERE plateName like '%'+char(13)+char(10)+'%'
If you get a positive row count, you'll know there was CR/LF data and it was removed. If you run the select afterwards, your lengths should be 7 and 8 based on your sample data