LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get rid of the last carriage return line feed from an array of numbers?

Hi
 
I am trying to remove the last carriage return line feed from an array of numbers?
 
Thank you.
 
 
0 Kudos
Message 1 of 10
(5,624 Views)
According to your question, I suppose that your array number is in fact a string... So you just need to chop the last char off.

Beware, you may have both a CR and a LF !

Message Edité par chilly charly le 08-19-2005 06:00 AM

Chilly Charly    (aka CC)
0 Kudos
Message 2 of 10
(5,625 Views)

Thanks for that.

 

In fact, the array of numbers is a 1 dimensional array of doubles.

 

Sorry for the misunderstanding.

 

Thank you.

0 Kudos
Message 3 of 10
(5,613 Views)
May be I missing something here, but to my knowledge there is no carriage return in numeric arrays ! 😄
 
So, I guess that what you mean is that you have an excess zero-value at the end of your array.
 
The solution is even simpler : just wire a "delete from array" function (in the Array sub-palette. You don't need to wire any additionnal index or length to the function. It drops the last element as default.
 
 

Message Edité par chilly charly le 08-19-2005 07:20 AM

Chilly Charly    (aka CC)
0 Kudos
Message 4 of 10
(5,612 Views)

Thanks for that.

No I do not have a zero at the end of my array.

Thank you.

 

0 Kudos
Message 5 of 10
(5,604 Views)
Since my cristal ball has some limits, ther is only one thing to do : post your array of double with carriage return !
Chilly Charly    (aka CC)
0 Kudos
Message 6 of 10
(5,601 Views)
"carriage return+linefeed" have only meaning for strings.
 
Could it be you are writing a 1D numeric array to a file (or a text indicator)?
 
Yes, "Array to spreadsheet string" will create a string that ends in a "\r\n". To strip is, simply take the string subset with start=0 and length="original lenght minus 2".
 
If you need more control on formatting, you could built the string in a loop using detailed custom formatting according to your needs. Anything is possible with LabVIEW.
 
Obviously, we have a language problem. As CC already said, attach a simplified version of your VI and it will be much easier for all of us to understand what the exact problem is. 🙂
0 Kudos
Message 7 of 10
(5,576 Views)

Thanks for that.

 

Yes I am writing to a file using writing to spreadsheet.vi.

 

Thank you.

0 Kudos
Message 8 of 10
(5,559 Views)

Hi again

 

How do I transpose the string using write to characters.vi?

The string that comes out is not an array.

 

Can you please help?

 

 

 

 

 

0 Kudos
Message 9 of 10
(5,559 Views)

Of course not. A file is just a long linear collection of characters. Certain characters separate items on a line  (e.g. tabs or comma) and others cause a new line. If a string indicator is set for normal display, it will "look" like a table. Same if you open the file in notepad. In reality is is just one long string, the formatting is done by convention.

If your rows and columns are swapped, you need to transpose your 2D array before converting it to a string. 🙂

I am sure we could help you much better if you could attach a small sample VI. Put your data in a diagram constant or as default values in your controls.

0 Kudos
Message 10 of 10
(5,548 Views)