I looked everywhere for a possible solution for this but I can't find anything and got stuck.
The problem:
I have two files containing data, when I read them into Java I store them in two separate arrays. These arrays look like this: (They are separated by a delimiter that is specified earlier on)
[ID pval logFC ... ... ...,
S145 0.02 2 ... ... ...,
S252 0.01 4 ... ... ...,
... ... ... ... ... ...]
[ID pval logFC ... ... ...,
S145 0.02 2 ... ... ...,
S252 0.01 4 ... ... ...,
... ... ... ... ... ...]
... <--- can be anything
So they don't have to have the same header columns. What I want to do is merge these two arrays into one file, where shared headers are stacked beneath each other and not shared headers are added but filled for the other with null.
Shared header not shared header
a a
a a
a a
a a
b null
b null
b null
In the end everything should be written to a file that is called combined.
Does anyone have an idea what classes could be used to do this? Are there already existing classes that can handle this kind of merges?