LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete character from string

Solved!
Go to solution

Hi 

I have string as shown

 

PROGRAM  = PASSED , XT ID  = PASSED , VERSION  = Abort , Temperature  = Abort , IDLE Current = Abort , ON_Current  = Abort , IMEI = Abort , SIM = Abort , GPS Ver  = Abort , GPS C/N  = Abort , Motion X  = PASSED , Motion  Y  = PASSED , Motion Z  = PASSED , vib Motor  = Abort , LED  = Abort , Tamper LGT  = Abort , Tamper DRK = Abort , MIC_Tone_Frequency  = Abort , MIC_Tone_Amplitude  = Abort , Ambient = Abort , Transceiver(BER)  = Abort , CHG_Current  = PASSED , Hall = Abort , Speaker = Abort , LCD Backlight = PASSED , STimer = Abort 

 

as you can see the string contain Test = result , Test2= result 

what I want to do delete each test that contain abort I want to delete 

example version= abort I want to delete also S TIMER= abort 

 

thanks very mush

 

 

0 Kudos
Message 1 of 7
(7,273 Views)
Solution
Accepted by topic author Elyan_wisam

I would start by using Spreadsheet String To Array with the comma as the delimiter.  This will give you an array of strings that should be Test = Result.  Now you can use a FOR loop to iterate through each of your strings.  Inside of the loop use Search/Split String to get just the result.  If the result is "Abort", delete that element from the array (or just not add it to the output array).  You can use Array To Spreadsheet String to get back to your string format.



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 2 of 7
(7,268 Views)

Hi

I get to section that I need to delete from string , how I can do that if I am inside the for loop ,

 

thanks

0 Kudos
Message 3 of 7
(7,251 Views)

I suceed to solve this

thanks

0 Kudos
Message 4 of 7
(7,242 Views)

@Elyan_wisam wrote:

I suceed to solve this

thanks


Please share how so other people can learn



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 5 of 7
(7,230 Views)

Re: Delete character from string - Discussion Forums - National Instruments

Hi 

I have string as shown

 PROGRAM  = (1,1) , XT ID  = (35612345,35612345) , VERSION  = (V5.12.7.1,V5.12.7.1) , Temperature  = (75,85) , IDLE Current = (0.03,0.06) , ON_Current  = (0.04,0.08) , IMEI = (358683068194647,358683068194647) , SIM =(Abort,Abort) , GPS Ver  = (GSD4e_4.1.2-P9_CCK F,GSD4e_4.1.2-P9_CCK F) , GPS C/N  = (38,60) , Motion X  = (50,360) , Motion  Y  = (50,360) , Motion Z  = (50,360) , vib Motor  = (1,1) , LED  = (1,1) , Tamper LGT  = (600,900) , Tamper DRK = (0,10) , MIC_Tone_Frequency  = (3230,3260) , MIC_Tone_Amplitude  = (3230,3260) , Ambient = (1,1) , Transceiver(BER)  = (0,0) , CHG_Current  = (0.3,0.6) , Hall =(Abort,Abort) , Speaker = (1,1) , LCD Backlight = (1,1) , STimer = (1,1)

 

as you can see the string contain Test1 = (min limit,max Limit) , Test2= (min limit,max Limit)

what I want to do delete each test that contain (Abort,Abort)

example Hall =(Abort,Abort) I want to delete 

 

thanks very mush

0 Kudos
Message 6 of 7
(7,235 Views)

Hi elyam,

 

so you got a solution on how to filter parts of your string - but you cannot use the very same algorithm for your changed input string?

And even worse: you need to create a new thread for the very same problem?

 

Side note: it's a VERY BAD idea to use the very same delimiter to separate items and values inside those items!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(7,211 Views)