Hello,
I have a hex string that contains the address then word:
0 8E39
1 60E3
2 1B
3 42
4 100
5 0
I am trying to generate two arrays, one with the address in two bytes and the other with the word in four bytes so that I will end up:
00 8E39
01 60E3
02 001B
03 0042
04 0100
05 0000
Any help will be greatly appreciated!
Thanks,
hiNi.
已解决! 转到解答。
Change your U16 Array constant into a 2D array and get rid of the FOR loop.

You can also directly use "read from spreadsheet file" (but you need to convert to U16 later).
@hiNI wrote:
I am trying to generate two arrays, one with the address in two bytes and the other with the word in four bytes so that I will end up:
You said you wanted two arrays, so you still need to slice out the two columns.

@hiNI wrote:
I am trying to generate two arrays, one with the address in two bytes and the other with the word in four bytes so that I will end up:.
Well, both the address and the word are currently in two bytes each (U16). "four bytes" would only make sense if you format the number into a hexadecimally formatted string (the display format of numerics has nothing to do with the underlying number of bytes).
Can you explain what you really want?
Why keep them in separate arrays? Why not use a 2D array to contain them? It seems the data is related and when kept separate there is a better chance for things to get misaligned.