03-09-2012 08:25 PM
Hello,
I have an array that I am acquiring from a test bench. It is always 1000 rows long and 11 columns wide. There are only 3 columns of the data that I am actually interested in. I have figured out how to delete the columns that i do not want. That is not a problem. The problem I am having is that the data that I want to keep is in a different column location from test to test. There is some constancy in the test data though. Each time the test runs there is one column that contains the number 65532 and the data that I am interested in is in the subsequent (kind of) three columns. It seems like I need to be able to determine which column has 65532 then reorganize the columns so that I can delete the columns I do not need. An additional problem I have is if the 65532 occurs in column 10, then the data I need resides in columns 11, 1 and 2.
Any ideas or pointers on how I could attack this problem?
Here is a visual example of what I am talking about. Pretend column g contains the number 65532.
a b c d e f g h i j k <-- Raw Data
g h i j k a b c d e f < --- Format I am looking for
Thanks.
Ron
03-10-2012 05:26 AM
Hi Ron,
- search for the magic number in your 2D array column-wise, resulting in column "x".
- When found you simply index the columns (x+1) mod 11, (x+2) mod 11, and (x+3) mod 11
You should adapt to "official" counting of rows/columns starting with zero. So the 10th column has index 9, while the 1st one has index 0...
03-10-2012 11:04 AM
03-10-2012 12:15 PM
Hi Ron,
If you transpose the array, then it gets pretty easy.
The "Found?" wire can be used for error checking.