Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Beginning Java 2
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 13th, 2004, 11:12 AM
Registered User
 
Join Date: Jun 2003
Location: Brentwood, CA, USA.
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

  #2 (permalink)  
Old October 15th, 2004, 07:34 AM
Authorized User
 
Join Date: Sep 2003
Location: den Haag, , Netherlands.
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

  #3 (permalink)  
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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:11 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.