LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove "zeros" form a txt file created by Labview

Hi all,
 
I got problems with a saved txt file and I hope somebody will me here.
 
I'm doing measurements and saving data in a txt file.
The data look as follow:  0.000000
                                        1.258766
                                        2.479566
                                        ............... 
My question is: how do I programatically  save these data without  "0.000000" so that the saved txt file looks like that: 1.258766
                                                                                                                                                                                            2.479566
 
Thank you for your help
 
Best regards
Kabanga
0 Kudos
Message 1 of 13
(4,206 Views)
Hi Kabanga,

well, usually this is a very nice tutorial questionSmiley Wink
One solution could be:

It's not very efficient, but works: In a first step the array is checked for zeros. In the FOR loop all those zeros are deleted, starting from the end of the array...


Message Edited by GerdW on 07-09-2008 11:57 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 13
(4,194 Views)
Check this http://forums.ni.com/ni/board/message?board.id=170&message.id=332775#M332775
Message 3 of 13
(4,191 Views)
Hi Kabanga,

you can trust muks as he now has a lot of experience on deleting items from arraysSmiley Very Happy

@muks:
Making the link as a real (clickable) link adds a lot of usabilitySmiley Wink


Message Edited by GerdW on 07-09-2008 12:09 PM
Best regards,
GerdW


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

Hi guys,

thanks a lot !Smiley Happy

I'm gonna try it and will let you know the outcome.

Best regards
Kabanga

0 Kudos
Message 5 of 13
(4,176 Views)

you can trust muks as he now has a lot of experience on deleting items from arrays

Right gerd.Thanx to you guys.
0 Kudos
Message 6 of 13
(4,160 Views)

@muks:
Making the link as a real (clickable) link adds a lot of usability

yup will do so from my next post.
0 Kudos
Message 7 of 13
(4,157 Views)

Hi Gerd,

I used your solution and it's working perfectly.

I don't see the "non efficiency" you were talking about. Could you give me more details on that point?

Thanks to you all guys your answers

Best regards
Kabanga

 

 

0 Kudos
Message 8 of 13
(4,152 Views)
Hi Kabanga,

the non-efficiency comes into play when 1) working on big arrays and/or 2) deleting lots of zeros in the array.

1) You create a new boolean array with the comparison function. This creates a new buffer, which may lead to problems when memory is full...
2) When deleting array elements LabView has to create a new copy of the array. Same problem as in point 1, but here even more problematic as this occurs in a loop: worst case is to allocate a new buffer and copy array items with each iteration...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(4,149 Views)

Hi Gerd,

I see now.....but I have  about 60 to 80 points to measure. 

So I think it will work perfectly.

Bets regars
Kabanga

 

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