I am struggling with an issue in Labview...I am trying to write a string of numbers to a csv file, but I want to be able cu arrange the string by a number of columns inputed from an user. The data.txt is just a sample, the initial file is much bigger, the data.csv is the only thing I managed to write, and I want when I input from a control for example 4 columns to rearrange the csv into my desired.csv. I appreciate any ideas or help that I can get.
Solved! Go to Solution.
Can you please explain with more details, because I just started learning labview...I know that with the reshape array function I can change the dimension, but where can I change the length?
See if this makes any sense. I am just getting the number of items in the original file and dividing by the number of desired columns to get the number of rows there will be. From there, it is just a simple Reshape Array.
I know that with the reshape array function I can change the dimension, but where can I change the length?
I'm not sure what you mean by your question -- are you talking about the input array to the function, or the "reshaped" array?
To change the size of an (input) array, you can add elements to it (using Build Array, or one of the "Insert" functions). You can create arrays of a specific size using Initialize Array, Build Array, or a For loop.
If you have an Input Array of size N, you can create an output Array of size M (which may or may not be equal to N) by using Reshape Array. For the sake of discussion, let's assume N is a 1D array and M is a 2D array, M = a*b. As the Help for Reshape Array clearly states, the output array will always be of size M = a*b. If M = N, then all the elements of N will be represented in M, with no "default values". If N < M, there will be default values (0 for numeric, False for boolean, empty for strings) for the last N-M entries, while if N > M, the last N-M entries will be missing, and M will be a truncated version of N.