01-07-2009 10:18 AM
Hi,
I want to split a 1d array of paths in an 2d array. Enclosed I have a copy of my 1d path-array. The aim should be that all filenames without extensions are in in one row. E.g.: 1st row: 00124241--.bst, 00124241--.dat,00124241--.par 2nd row: 00124244--.dat, 00124244--.par - and so on. My static solution for that can't handle a missing file type because of the modulo function of the file types.
Has anybody an idea?
Kind Regards,
--
Joachim
Solved! Go to Solution.
01-07-2009 10:39 AM - edited 01-07-2009 10:44 AM
Since you have an odd number of element, you need to decide how you should pad for missing elements
Are the names always alternating?
In this case you could do a "decimate" followed by a "built array". You could also "reshape" to a 2D array with 1/3 the rows and three columns.
01-07-2009 12:21 PM
Hi,
no I havn't always an odd number of elements. If I have a file pattern with 3 types (*.par, *.dat, *.bst) and one order the *.bst file is missing the funtion should also give me a row with 2 elements. The filename without extension is the criteria for the elements in a row.
Yes the file names are adjacent because I do a 1d array sort before.
A decimate array can't help me in this case, isn't it?
Kind Regards,
--
Joachim
01-07-2009 01:29 PM
Joachim082 wrote:no I havn't always an odd number of elements. If I have a file pattern with 3 types (*.par, *.dat, *.bst) and one order the *.bst file is missing the funtion should also give me a row with 2 elements. The filename without extension is the criteria for the elements in a row.
In a 2D array, all rows must have the same number of elements, a solution would be to use an array of clusters, each conttaining a 1D array for each row.
Can you attach a simple VI containing a typical path array as a diagram constant so I don't need to start from scratch? Thanks!
01-07-2009 02:14 PM
yes - when I use a 2D array I can decimate in every 1d loop-iteration the empty elements.
I've attached a simple vi with a an path array.
01-07-2009 03:20 PM - edited 01-07-2009 03:21 PM
Try something like this. Modify as needed. 🙂