LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove blanks before file write

I am finding peaks in real-time and then writing the peaks and the signal to a text file. Obviously depending on the sampling rate and number of samples per channel, i have blank rows in the peaks column (attched text file).

I would like to remove these blanks before writing the value to a text file. I have spend a lot of time on it without any success.

 

 

Download All
0 Kudos
Message 1 of 3
(2,360 Views)

Hi zezendapuss,

 

would like to remove these blanks before writing the value to a text file.

I guess those blanks are due to different array sizes of your signal data and peak data. When you don't want to have blanks you need to provide the same array size for all columns!

 

I have spend a lot of time on it without any success.

What have you tried so far?

Where are you stuck?

What went wrong?

Best regards,
GerdW


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

Are you writing to the file every 0.1 second or are you building arrays and then writing to file once?

If you are writing to file multiple times, you can not extend column - because "table" file data are in fact single continuous string, separated by "end of lines". Technically you can write 8 spaces (precision of peaks) instead of peaks data, then replace these spaces with peaks at correct places... it is possible.

You can save binary data, write postprocessor to convert them. 

You can keep peaks array, write it to a separate file.

You can make a lot of space for peaks data (first row) and then control file write position - to the end for main data, or into first line (save last write position) for peaks data.

Tables are not very good for storing columns of different size..

0 Kudos
Message 3 of 3
(2,329 Views)