LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Removing the Number and special characters from string

Hi everyone , 

 

please find attachment 

 

I need to the remove the numbers and Special charcters from the String . only i need to filter the text sentence ( Name of the driver ) and put those things in list box or  table (UI )  . I tried with the Match pattern and Search and Replace function. 

 

Thanks in advance 

guide me 

0 Kudos
Message 1 of 13
(5,126 Views)

Hi bhuvanesh,

 

first: please don't use Office files to provide simple text information:

drivers  T D D Y C I R P F A V VERSION E G G #D #C DRIVER NAME  IMAGE NAME   2F 00000010 ? N N 0 0 Storage Security Command Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(70D57D67-7F05-494D- A014-B75D7345B700) 4E 00000001 B N N 1 1 AHCI Bus Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(3ACC966D-8E33-45C6- B4FE-62724BCD15A9) 56 00000001 B N N 1 1 SD Host Controller Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(67BBC344-84BC-4E5C- B4DF-F5E4A00E1F3A) 57 00000001 B N N 1 1 MMC/SD Media Device Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(86EDAAE5-073C-4C89- B949-8984AC8A55F3) 5A 0000000A B N N 1 1 Serial Terminal Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(9E863906-A40F-4875- 977F-5B93FF237FC6)  5B 00000010 ? N N 0 0 PCI Serial Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(A6CC6BC8-2ADA-46C3- BBA4-E99672CC9530) 64 00000001 D N N 1 0 <null string> Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(38A0EC22-FBE7-4911- 8BC1-176E0D6C1DBD) 6E 00000010 ? N N 0 0 PCI IDE/ATAPI Bus Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(69FD8E47-A161-4550- B01A-5594CEB2B2B2) E8 0000000A D N N 1 0 Platform Console Management Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(51CCF399-4FDF-4E55- A45B-E123F84D456A) E9 0000000A D N N 1 0 Platform Console Management Driver EA 0000000A D N N 17 0 Generic Disk I/O Driver Fv(A881D567-6CB0-4EEE-8435-2E72D33E45B5)/FvFile(6B38F7B4-

Then you need to define "numbers" and "special characters" for that string.

Which information exactly do you need from that string? Please provide examples…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(5,122 Views)

Hi gerdw , 

 

Just i need to eliminate the Numbers , special Characters  in the String . 

I need in this format 

  1. Storage Security Command driver 
  2. AHCI Bus Driver 
  3. SD Host controller Driver and so on ......,( in table or Listbox - UI ) 

 

0 Kudos
Message 3 of 13
(5,111 Views)

@Mrtechie wrote:

Hi gerdw , 

 

Just i need to eliminate the Numbers , special Characters  in the String . 

I need in this format 

  1. Storage Security Command driver 
  2. AHCI Bus Driver 
  3. SD Host controller Driver and so on ......,( in table or Listbox - UI )

Still not enough information to really help.  Perhaps an example of what you expect as an output would help.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 13
(5,096 Views)

First, strip the header. It has 'strings' so it would be hard to distinguish between those strings and the desired strings. This is simply a split string.

 

From there on, you have a world of methods to choose from.

 

How do you want the result? A string? Tab delimited, or comma separated, or other? Or an array?

 

Removing 'special characters' might also remove spaces from the desired 'strings'...

 

I'd do a regular expression, in a while loop if I really wanted to find 'strings without special characters'. But your format probably is well defined. A scan from string will be more robust.

 

Something like "%02x %08x %[^ ] %[^ ] %[^ ] %d %d %[^(] (%[^)])"

 

Scanning hex, hex, string (not space), string (not space), string (not space), integer, integer, (, string (not '(')), string (not ')'), )

0 Kudos
Message 5 of 13
(5,084 Views)

Hi crossrulz , 

From the logs ( please see attachment ) , i need only the text sentence .. From the Attachment you see the Different driver names . i need to filter the names of those . understand ?? 

 

Gerdw itself take a screenshot of those . please see that 

0 Kudos
Message 6 of 13
(5,082 Views)

Hi Carya , 

 

yes Exactly you understood . i need a result in Multicolumn listbox or array .. only result matters 🙂 

 

i extracted the numbers and special characters seperately . pls look at this . attached a VI 

0 Kudos
Message 7 of 13
(5,074 Views)

There's no telling what is allowed in this format (without a spec.). For now, the attached VI seems to return an array of all the devices.

0 Kudos
Message 8 of 13
(5,055 Views)

Hi carya , 

 

The Real time Logs are changing a little bit ( i.e.. spaces and some other characters   )  So the Format you gave in the Scan String is not extracting the same Result  every time  .  need to change the algorithm seems . Shall we use the  Search & Replace and match pattern Function in a other way ?

 

Guide Me ...

Thanx a lot everyone in advance ! 

0 Kudos
Message 9 of 13
(5,017 Views)

@Mrtechie wrote:

Shall we use the  Search & Replace and match pattern Function in a other way ?

We can use Search & Replace or Match Pattern (I'd use Match Regular Expression, much more powerful) any way we like.

 

As for now, I don't know the exact requirements. It would be difficult to get any function to remove spaces when undesired, and keep them when the are desired, without a solid criterium...

 

Perhaps you can post a log that fails? Then at least we could try to fix those situations.

0 Kudos
Message 10 of 13
(4,970 Views)