From: Aju M. <aju...@ao...> - 2013-08-25 19:24:38
|
Does the API provide this , i am unable to find anything in the java doc. Does any workaround exist. -----Original Message----- From: Aju Mathai <aju...@ao...> To: flatpack-user <fla...@li...> Sent: Sun, Aug 25, 2013 1:42 am Subject: [flatpack-user] Help Required Hi, I needed some help , i am parsing a fixed width file. The file contains multiple record types each of length 200 bytes. After i have parsed the records, i need to check the length of each row should be equal to 200 bytes. Can i get this information using the API ? InputStream is =null; try { is = new FileInputStream(getDefaultMapping()); } catch (FileNotFoundException e) { e.printStackTrace(); } Reader mappingFileReader = new BufferedReader(new InputStreamReader(is)); Reader datFileReader = new BufferedReader(new InputStreamReader((FileInputStream) message.getPayload())); final Parser pzparser = DefaultParserFactory.getInstance().newFixedLengthParser(mappingFileReader, datFileReader ); final DataSet ds = pzparser.parse(); if (ds.isRecordID("segment")) { //Check Record is 200 bytes } if (ds.isRecordID("trailer")) { //Check Record is 200 bytes } if (ds.isRecordID("header")) { //Check Record is 200 bytes } Thanks mathaj ------------------------------------------------------------------------------ Introducing Performance Central, a new site from SourceForge and AppDynamics. Performance Central is your source for news, insights, analysis and resources for efficient Application Performance Management. Visit us today! http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk _______________________________________________ flatpack-user mailing list fla...@li... https://lists.sourceforge.net/lists/listinfo/flatpack-user |