Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
|
BOOK: Beginning Java 2
This is the forum to discuss the Wrox book Beginning Java 2, SDK 1.4 Edition by Ivor Horton; ISBN: 9780764543654
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 13th, 2004, 11:12 AM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default parsing a flat file in java

Greetings,

I am new to java and would like to try parsing a small positional flat file. I plan to then use JDOM to write out an XML file.

I was hoping someone would have an example to get me started, I don't have any code to post just yet but it would be helpful to get suggestions on the right direction to go.

The file layout is:

NN86011111107XXX12345699999999999999999xxxxxxxxxxx xxxxxx0000000121000xxxxxxxxxxxxxxx
NN86011111107XXX12345899999999999999888xxxxxxxxxxx xxxxxx0000000151000xxxxxxxxxxxxxxx


I really only need 5 fields from this file amount of data form this file:
PO num: 111111
receiving ware house: 07
item code: 123456
CUPC: 9999999999999999999
qty: 000000012

Any suggestion on parsing the positional data would be most appreciated.

Thank you

Rod

 
Old October 15th, 2004, 07:34 AM
Authorized User
 
Join Date: Sep 2003
Posts: 98
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check out the XML downloads of Sun

http://wwws.sun.com/software/downloa...b=3&subcat=XML

 
Old May 18th, 2009, 09:11 AM
Registered User
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Java library that does the job

I have created an open souce java library that can parse and generate flat files (and csv files) according to a schema specified in xml.

Have a look at http://jsapar.tigris.org





Similar Threads
Thread Thread Starter Forum Replies Last Post
parsing flat xml file using asp.net 2.0 mikecarmody XML 5 April 28th, 2008 02:55 AM
Java - XML parsing p_bunny XSLT 1 September 8th, 2005 01:59 AM
How to Parse - Parsing Flat File Data - Asp darinsee Classic ASP Databases 5 May 24th, 2004 04:11 PM
Parse - Parsing Flat File Data - Asp darinsee Classic ASP Basics 1 May 22nd, 2004 08:39 AM
Parse - Parsing Flat File Data - Asp darinsee Classic ASP Components 1 May 22nd, 2004 08:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.