deserializing multi line csv object

19 views
Skip to first unread message

Marek Andreánsky

unread,
Nov 1, 2021, 2:35:41 PM11/1/21
to jackson-user
Is there a recommended way of deserializing a csv file where one object can be spread among multiple lines?

An example is:

id,text,element
1,test,element1
1,test,element2

and the expected object is (1,test,[element1,element2]) where id is the primary key.

Tatu Saloranta

unread,
Nov 4, 2021, 11:40:27 AM11/4/21
to jackso...@googlegroups.com
No, I don't think there is support for such aggregation operations.
You would need to implement that on top of regular reading.

-+ Tatu +-

>
> --
> You received this message because you are subscribed to the Google Groups "jackson-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jackson-user...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/ba9bf1a5-2e6d-44d0-bd46-91200ef70d0fn%40googlegroups.com.

Александр Илюшкин

unread,
Nov 8, 2021, 5:58:19 PM11/8/21
to jackson-user
You could try to implement middle operation in your process by loading your csv data into an instance of HSQL DB (SQL Database in pure java).
You could execute familiar SQL requests over your csv data after that.
I think, it is better than doing this bicycle once again engine by yourself. Loading your csv into database is more flexible in perpective, when you wanna change your kind of grouping data, or want to add new kind of data representations.

четверг, 4 ноября 2021 г. в 18:40:27 UTC+3, Tatu Saloranta:
Reply all
Reply to author
Forward
0 new messages