Question: JAVA In JAVA, please describe and provide an example of how to read key-value pair input from a file and flatten the data so the

JAVA In JAVA, please describe and provide an example of how to read key-value pair input from a file and flatten the data so the data can be ingested.

Input data:

id=10^^name=bel, james^^ city=paris

id=11^^name=smith, ^peter^^city=Chicago

id=12^^name=mcdonalds, julie^^city=NY=C

Things to consider:

1. ^^ is the delimiter between each key value pair.

2. = is the delimiter within a key value pair.

3. The VALUE can be NULL but the KEY cannot be NULL

4. There could be a partial delimiter or multiple delimiters in a VALUE. In these cases, remove ^ and = from values

Expected output format:

id|name|city

bel|james|paris

smith|peter||Chicago

mcdonalds|julie|NYC

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!