I am getting in my java code a variable with the following value
String arquivo = "CNPJ;INSCRICAOESTADUAL;COD_IBGE;DT_OPE;VLR_CARTAO_CRED;VLR_CARTAO_DEB
35083840049;0;4312476;13/01/2018;0.00;66.00
35083840049;0;4312476;18/01/2018;33.00;26.00
35083840049;0;4312476;19/01/2018;0.00;38.40
35083840049;0;4312476;20/01/2018;0.00;55.00
35083840049;0;4312476;21/01/2018;59.80;0.00
35083840049;0;4312476;31/01/2018;0.00;122.00
91589507000854;3770005769;4312476;02/01/2018;2492.59;2742.34
91589507000854;3770005769;4312476;03/01/2018;1333.95;1686.86"
However, I want to throw these values in an array where, respectively, CNPJ
is 35083840049
INSCRICAOESTADUAL
is 0
and so on with other values.
When debugging the code I saw that I'm having the following result:
Thatis,itisassemblinganarraywithalltheresult.
I'musingthismethod:
Stringarquivo=arquivoDecodificado;String[]items=arquivo.split(";");
List<String> itemList = new ArrayList<String>();
for (String item : items) {
itemList.add(item);
}
System.out.println(itemList);
How can I do to leave the way I need ??