This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I've seen nothing relevant on the internet, other than just basic deep copies.
Well, since you can't change the size of an array once it has been declared, the only relevant solution is to declare a new array, of a size that can hold both arrays, and copying the two source arrays into it.
I guess what I'm asking is how would you go about combining or appending two multidimensional arrays together. I've been unable to find any kind of example. Or clue on how to do this other than just a straight one to one copy.
The intent behind the code is : I'm attempting to parse multiple csv files. The CSVParser in the program outputs the parse into a multidimensional String array. For each CSV file I process, I'd like to add the individual files into a Big One. Essentially, I need to add the contents of one Multidimensional Array to another.
I don't really have any data at this time to show you, It's more of a concept at this time. I just wanted to know if it was possible.
If I'm not being clear i apologize. I do appreciate your help.
The issue here is that 'adding two multi-dimensional arrays' is not well defined.
Imagine i have two documents printed on paper, and i want to 'combine them'. do i
a) place document 'A' on top of 'B'?
b) Shuffle them together like a deck of cards, so i have A.page1 followed by B.page1 followed by A.page2...
c) Do I cut-n-past the contents of B.page1 physically onto A.page1
d) do i drop both into the paper shredder and mix up the resulting scraps?
All of these are valid ways of 'combining two paper documents' - each would be appropriate in certain situations.
The analogy is similar for what you are asking. We're not sure how exactly you would want to combine your arrays, so specific help is hard to give.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joined: Oct 10, 2008
Thank you all for your reply's:
I'm not trying to be dense, I'm just not sure how to describe this. The two documents would be similar to this...
The program in question would parse each file into it's own multidimensional String array.
I would like to take both of these Multidimensional String arrays and put them together into another multidimensional array.....
This would be the desired content of the "third multidimensional array....
The third array would be an "accumulation" of all the data from all the different arrays...