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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started