Java application to convert .CSV data to XML format brackish . burnt umber Created on September 15 , 2007 , 7 :57 PM To change this template , choose Tools scout Manager and exculpated the template in the editorpackage csvtoxmlconv authorimport coffee tree .ioimport java .utilpublic course of instruction primary(prenominal) Creates a new pillow part of Mainpublic Main param args the command place argumentspublic static void main (String[] args / TODO code application system of logic hereconvert (args Accept call for scuttlebutt csv and make xml Process the csv input utilise BufferedReader phratry and split the line data using StringTokenizer class fix up the output data using xml sentence structure principle Write the formatted data to the output xml using BufferedWriter class param the names of the source csv and the name of the xml outputpublic static void convert (String[]BufferedReader inBufferedWriter outString rowData ,StrDateint newspaper column ,colDateboolean HasElementsFlag tryin new BufferedReader (new Reader ([0]out new BufferedWriter (new Writer ([1]rowDataout .write while (rowData nullrowData in .readLinecolumn 0if (rowData nullHasElementsFlag falseStringTokenizer Tok new StringTokenizer (rowDatawhile (Tok .hasMoreElementsHasElementsFlag trueswitch (column fiber 0out .write out .write Tok .nextElement breakcase 1out .write Tok .nextElement breakcase 2out .write Tok .nextElement breakcase 3out .write Tok .nextElement breakcase 4out .write StrDate Tok .nextTokenStringTokenizer pDate new StringTokenizer (StrDatecolDate 0while (pDate .hasMoreElementsswitch (colDatecase 0out .write pDate .nextElement break case 1out .write pDate .nextElement break case 2out .write pDate .nextElement breakcolDateout .write breakcase 5out .write Tok .
nextElement breakcase 6out .write Tok .nextElement breakcase 7out .write Tok .nextElement breakcase 8out .write Tok .nextElement breakcase 9out .write Tok .nextElement breakcase 10out .write Tok .nextElement breakcase 11out .write Tok .nextElement breakcolumnif (HasElementsFlagout .write out .writein .closeout .flushout .close system .out .println CSV [0] ) has been successfully converted to XML [1]catch ( NotFoundException e System .out .println CSV not foundcatch ( IOException e System .out .println ( ethe external sustenance (generated with javadoc ) for the java applicationSee name - javadoc .htmlThe input .CSV dataSee name - name .csvThe output (resulting XML papers br1AA001F7p 21072007p GAEmergencyNoYesYesYesHEp2AA002F7p 24062007p RAElectiveYesYesYesNoHPp3AA001M7p 07052006p GAElectiveYesNoNoNoHPp3AA001M7p 01042006p LAElectiveYesYesYesNoKPp4AA003F8p 31082006p GAElectiveYesYesNoNoORp5BB001M9p 2006...If you want to get a full essay, put up it on our website: OrderCustomPaper.com
If you want to get a full essay, visit our page: write my paper
No comments:
Post a Comment