Java application to convert .CSV data to XML format briny . burnt umber Created on September 15 , 2007 , 7 :57 PM To change this template , choose Tools templet Manager and exculpated the template in the editorpackage csvtoxmlconv authorimport coffee bean .ioimport java .utilpublic course of instruction important Creates a new pillow berth of Mainpublic Main param args the command place argumentspublic static void main (String[] args / TODO code application system of logic hereconvert (args Accept name calling for scuttlebutt csv and getup xml Process the csv input utilise BufferedReader course and split the line data using StringTokenizer class data formatting the output data using xml sentence structure curb Write the formatted data to the output xml using BufferedWriter class param the name calling of the source csv and the name of the xml outputpublic static void convert (String[]BufferedReader inBufferedWriter outString rowData ,StrDateint tower ,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 enfranchisement (generated with javadoc ) for the java applicationSee name - javadoc .htmlThe input .CSV dataSee name - name .csvThe output (resulting XML papers br1AA001F7p 21072007p GAE mergencyNoYesYesYesHEp2AA002F7p 24062007p RAElectiveYesYesYesNoHPp3AA001M7p 07052006p GAElectiveYesNoNoNoHPp3AA001M7p 01042006p LAElectiveYesYesYesNoKPp4AA003F8p 31082006p GAElectiveYesYesNoNoORp5BB001M9p 2006...If you want to get a full essay, high society 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