problem while formatting data from csv file to another csv file
807588Apr 20 2009 — edited May 1 2009Hi,
I am new to JAVA programming. I am trying to get data from csv file and send that data to another csv file in different format. I am not able to do that. My input file looks like:-
__input.csv__
CLIMATE, 1, 1, 23, DMY, 200, 198, 2
CLIMATE, 1, 1, 23, 4AS, 658, 657,1
CLIMATE, 1, 1, 23, 5ON, 214, 212,2
DEVIATIONS,1,1,23,DMY,200,198,2
DEVIATIONS,1,1,23,4AS,658,657,1
DEVIATIONS,1,1,23,5ON,214,212,2
My output file should be like:---
output.csv*
CLIMATE, 1,1,23, *200*, _658_, 214, *198*, _657_, 212, *2*, _1_, 2
DEVIATION,1,1,23, *200*, _658_, 214, *198*, _657_, 212, *2*, _1_, 2
In above file the bold data is first line of input file. Italic data is second line from input file and plain text is third line from input text.
I have tried with hashmap and may loop logic also. but i am not able to complete this.
Can any one help me to achieve this?
Thanks in advance.