From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reorder table

Hi, I need to re-order Table 1, in such way that it becomes in transformed in Table 2.  Afterwards I Table 2 to be stored in an excel file:

 

 

Table 1

 

1,0          212

1,1          34

1,2          3

1,3          4

1,4          3

1,5          324

1,6          234

1,7          325

1,8          532

1,9          42

2,0          423

2,1          4

2,2          324

2,3          32

2,4          34

2,5          234

2,6          324

2,7          23

2,8          4

2,9          35

3,0          5

3,1          426

3,2          546

3,3          54

3,4          2

3,5          34

3,6          324

3,7          234

3,8          234

3,9          234

4,0          234

 

 

 

Table 2

                0,0          0,1          0,2          0,3          0,4          0,5          0,6          0,7          0,8          0,9

1,0           212         34           3             4             3             324         234         325         532         42

2,0           423         4             324         32           34           234         324         23           4             35

3,0           5             426         546         54           2             34           324         234         234         234

4,0           234        

 

 

In Table 2 it can be seen that in the first row are the decimal part of the values that appear in the first column of Table 1. On the other hand, the first column of Table 2 is composed of the integer part of the values that appear in the first column of Table 1

 

Thnak you very much.

 

0 Kudos
Message 1 of 5
(2,375 Views)

Your description seems incomplete.

 

  1. Does it always start with 1.0 or could it be something else. Could values in the first column be negative?
  2. Are the values always consecutive and incrementing by 0.1 or could there be gaps.
  3. Is the first column always sorted?
  4. Could there be an unlimited number of rows?

Here's a simple example snipped that assumes an unlimited number of rows starting with 1.0 and does not assume that the first column is sorted.

 

There are many ways to do this. I assume you know how to write the final array to your desired file format.

 

Message 2 of 5
(2,369 Views)

Thanks

 

  1. Does it always start with 1.0 or could it be something else. Could values in the first column be negative?: It always starts with 0
  2. Are the values always consecutive and incrementing by 0.1 or could there be gaps. Always consecutive and incrementing by 0.1
  3. Is the first column always sorted? Yes.
  4. Could there be an unlimited number of rows? No.

0 Kudos
Message 3 of 5
(2,366 Views)

...And the input is a nx1 array.

0 Kudos
Message 4 of 5
(2,365 Views)

@fgarcia wrote:
  1. Does it always start with 1.0 or could it be something else. Could values in the first column be negative?: It always starts with 0

Well, your example data starts with 1.0, already breaking the rule. 😄

 

Your specification change is nothing a "+1" here or there cannot fix... 😉

Message 5 of 5
(2,363 Views)