|
From: <zep...@us...> - 2007-09-05 17:18:24
|
Revision: 345
http://flatpack.svn.sourceforge.net/flatpack/?rev=345&view=rev
Author: zepernick
Date: 2007-09-05 10:18:20 -0700 (Wed, 05 Sep 2007)
Log Message:
-----------
fixed examples to reflect flatpack instead of pzfilereader
Modified Paths:
--------------
trunk/src/site/index.xml
Modified: trunk/src/site/index.xml
===================================================================
--- trunk/src/site/index.xml 2007-08-30 11:13:54 UTC (rev 344)
+++ trunk/src/site/index.xml 2007-09-05 17:18:20 UTC (rev 345)
@@ -1,123 +1,123 @@
-<document>
- <properties>
- <author email="pa...@ya...">Paul Zepernick</author>
- <title>Introduction</title>
- </properties>
- <head>
- <meta name="description"
- content="Flat File Parser (fixed length, csv, etc) via XML Column Mappings, released under the business-friendly Apache 2.0 license."
- />
-
- <meta name="keywords"
- content="Java CSV, Java Fixed Width, Open Source Java Parser, Java Delimited, Java Fixed Width, Java Flat File, Java Text Parser" />
- <meta name="Subject" content="Flat File Parser" />
- <!--<meta name="Copyright" content="ObjectLab Financial Ltd" />-->
- <meta name="Language" content="English" />
- <meta name="Designer" content="Paul Zepernick" />
- <meta name="Distribution" content="Global" />
- <meta name="robots" content="ALL"/>
- <meta name="Revisit-After" content="20 Days" />
- </head>
- <body>
- <!-- The body of the document contains a number of sections -->
+<document>
+ <properties>
+ <author email="pa...@ya...">Paul Zepernick</author>
+ <title>Introduction</title>
+ </properties>
+ <head>
+ <meta name="description"
+ content="Flat File Parser (fixed length, csv, etc) via XML Column Mappings, released under the business-friendly Apache 2.0 license."
+ />
+
+ <meta name="keywords"
+ content="Java CSV, Java Fixed Width, Open Source Java Parser, Java Delimited, Java Fixed Width, Java Flat File, Java Text Parser" />
+ <meta name="Subject" content="Flat File Parser" />
+ <!--<meta name="Copyright" content="ObjectLab Financial Ltd" />-->
+ <meta name="Language" content="English" />
+ <meta name="Designer" content="Paul Zepernick" />
+ <meta name="Distribution" content="Global" />
+ <meta name="robots" content="ALL"/>
+ <meta name="Revisit-After" content="20 Days" />
+ </head>
+ <body>
+ <!-- The body of the document contains a number of sections -->
<section name="News">
<p style="margin-top:10px; margin-bottom:0; padding-bottom:0; text-align:center; line-height:0"><a href="http://feeds.feedburner.com/~r/ObjectlabOpenSourceNews/~6/1"><img src="http://feeds.feedburner.com/ObjectlabOpenSourceNews.1.gif" alt="ObjectLab Open Source News" style="border:0"/></a></p><p style="margin-top:5px; padding-top:0; font-size:x-small; text-align:center"><a href="http://www.feedburner.com/fb/a/headlineanimator/install?id=829470&w=1" onclick="window.open(this.href, 'haHowto', 'width=520,height=600,toolbar=no,address=no,resizable=yes,scrollbars'); return false" target="_blank">Grab this Headline Animator</a></p>
<p>Feb 11, 2007: PZFileReader 3.0.0 is released, new interfaces (not backward compatible) but great performance improvements (order of magnitude).</p>
</section>
- <section name="FlatPack Introduction">
-
- <p>FlatPack came out of the frustration of having to mix file parsing logic with business logic.</p>
-
- <p>FlatPack on SourceForge: a Java (1.4+) flat file parser that handles CSV, fixed length and custom delimiters. The formats are configured in XML, it is fast and released under Apache license 2.0.</p>
-
- <p>Substrings in a <strong>fixed width parse</strong> can be daunting to deal with when trying to analyze what existing code is doing,
- and what about when you have no comments...</p>
-
- <p>We also provide <strong>delimited file parsing</strong>; works with any delimiter / qualifier, multiline records, delimiter or qualifier allowed in column value.</p>
-
- <p>A manual is available as <a href="documentation/flatpack-manual.doc">Word</a> document or a <a href="documentation/flatpack-manual.pdf">PDF</a>.</p>
-
- <p>FlatPack is part of the ObjectLab Kit family.<a href="http://digg.com/submit?phase=2&url=objectlabkit.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming">
- <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a></p>
-
- <subsection name="Why should you use FlatPack?">
-
- <p>There is more to it than one could imagine at first sight:</p>
- <ul>
-
- <li><strong>Problem Sorting Data Prior To File Processing?</strong></li>
- <ul><li>FlatPack provides a sorting mechanism for your flat files. This allows for your data to be properly sorted before processing your business logic.</li></ul>
-
-
- <li><strong>Bad Numeric Data?</strong></li>
- <ul><li>Do you often receive numeric data with dollar signs, or commas? FlatPack has the ability to strip these out and return as a double or int.
- Even empty elements or hard spaces can be converted to a numeric without issue.</li></ul>
-
- <li><strong>Problems With One Bad Record Blowing Up The Entire Parse?</strong></li>
- <ul><li>Bad records get excluded from the DataSet and added to an error collection. This error collection can be checked at the end of the parse to
- report on bad records. A description of the error and the line number in the file is provided. Why blow up an entire import for one bad record?</li></ul>
- </ul>
- </subsection>
-
- <subsection name="Which JDK?">
- <p>1.4 and up</p>
- </subsection>
-
- <subsection name="UML?">
- <p>We are using yDoc to generate a 'javadoc-like' documentation per module with the added twist of UML diagrams:</p>
- <ul>
- <li><a href="multiproject/flatpack/apidocs/index.html">UML for FlatPack</a></li>
- <li><a href="multiproject/flatpack-examples/apidocs/index.html">UML for Examples</a></li>
- </ul>
- </subsection>
-
- </section>
-
- <section name="How do I use it?">
- <p>Basic Steps</p>
+ <section name="FlatPack Introduction">
+
+ <p>FlatPack came out of the frustration of having to mix file parsing logic with business logic.</p>
+
+ <p>FlatPack on SourceForge: a Java (1.4+) flat file parser that handles CSV, fixed length and custom delimiters. The formats are configured in XML, it is fast and released under Apache license 2.0.</p>
+
+ <p>Substrings in a <strong>fixed width parse</strong> can be daunting to deal with when trying to analyze what existing code is doing,
+ and what about when you have no comments...</p>
+
+ <p>We also provide <strong>delimited file parsing</strong>; works with any delimiter / qualifier, multiline records, delimiter or qualifier allowed in column value.</p>
+
+ <p>A manual is available as <a href="documentation/flatpack-manual.doc">Word</a> document or a <a href="documentation/flatpack-manual.pdf">PDF</a>.</p>
+
+ <p>FlatPack is part of the ObjectLab Kit family.<a href="http://digg.com/submit?phase=2&url=objectlabkit.sourceforge.net&title=Paul%20Zepernick%20and%20ObjectLab%20have%20released%20version%202%2E3%2E0%20of%20FlatPack%2E&bodytext=FlatPack%20on%20SourceForge%3A%20a%20Java%20(1%2E4%2B)%20flat%20file%20parser%20that%20handles%20CSV,%20fixed%20length%20and%20custom%20delimiters%2E%20The%20formats%20are%20configured%20in%20XML%20or%20in%20DB%2E%20Once%20parsed%20the%20data%20is%20easily%20accessible%20record%20by%20record%20and%20via%20a%20column%20name,%20regardless%20of%20order%2E%20%20It%20is%20fast%20and%20released%20under%20Apache%20license%202%2E0%2E&topic=programming">
+ <img src="http://digg.com/img/badges/91x17-digg-button.png" width="91" height="17" alt="Digg!" style="vertical-align:middle" /></a></p>
+
+ <subsection name="Why should you use FlatPack?">
+
+ <p>There is more to it than one could imagine at first sight:</p>
+ <ul>
+
+ <li><strong>Problem Sorting Data Prior To File Processing?</strong></li>
+ <ul><li>FlatPack provides a sorting mechanism for your flat files. This allows for your data to be properly sorted before processing your business logic.</li></ul>
+
+
+ <li><strong>Bad Numeric Data?</strong></li>
+ <ul><li>Do you often receive numeric data with dollar signs, or commas? FlatPack has the ability to strip these out and return as a double or int.
+ Even empty elements or hard spaces can be converted to a numeric without issue.</li></ul>
+
+ <li><strong>Problems With One Bad Record Blowing Up The Entire Parse?</strong></li>
+ <ul><li>Bad records get excluded from the DataSet and added to an error collection. This error collection can be checked at the end of the parse to
+ report on bad records. A description of the error and the line number in the file is provided. Why blow up an entire import for one bad record?</li></ul>
+ </ul>
+ </subsection>
+
+ <subsection name="Which JDK?">
+ <p>1.4 and up</p>
+ </subsection>
+
+ <subsection name="UML?">
+ <p>We are using yDoc to generate a 'javadoc-like' documentation per module with the added twist of UML diagrams:</p>
+ <ul>
+ <li><a href="multiproject/flatpack/apidocs/index.html">UML for FlatPack</a></li>
+ <li><a href="multiproject/flatpack-examples/apidocs/index.html">UML for Examples</a></li>
+ </ul>
+ </subsection>
+
+ </section>
+
+ <section name="How do I use it?">
+ <p>Basic Steps</p>
<ol>
<li>Obtain a PZParser from a parser factory (DefaultPZParserFactory) witha File, InputStream, or a reader(coming soon)</li>
- <li>Set additional PZParser options, PZParser.setAnOption()</li>
- <li>Obtain a DataSet PZParser.parse()</li>
- <li>Call DataSet.next() to advance record pointer</li>
- <li>Process columns; DataSet.getString("colname"), getInt("colname"), getDouble("colname"), getDate("colname"), etc</li>
- <li>Check for parse errors; DataSet.getErrors()</li>
- </ol>
-
- <subsection name="Reading Delimited File With Column Mapping">
-
+ <li>Set additional PZParser options, PZParser.setAnOption()</li>
+ <li>Obtain a DataSet PZParser.parse()</li>
+ <li>Call DataSet.next() to advance record pointer</li>
+ <li>Process columns; DataSet.getString("colname"), getInt("colname"), getDouble("colname"), getDate("colname"), etc</li>
+ <li>Check for parse errors; DataSet.getErrors()</li>
+ </ol>
+
+ <subsection name="Reading Delimited File With Column Mapping">
+
<div class="source"><pre>
//Obtain the proper parser for your needs
- PZParser pzparser = DefaultPZParserFactory.getInstance().newDelimitedParser(
- new File("map.pzmap.xml"), //xml column mapping
- new File("DataFile.txt"), //txt file to parse
+ Parser parser = DefaultParserFactory.getInstance().newDelimitedParser(
+ new FileReader("map.pzmap.xml"), //xml column mapping
+ new FileReader("DataFile.txt"), //txt file to parse
',', //delimiter
'"', //text qualfier
false); //ignore the first record (may need to be done if first record contain column names)
-
- //obtain DataSet
- DataSet ds = pzparser.parse();
-
- while (ds.next()){ //loop through file
- ds.getString("mycolumnName");
- }
- </pre></div>
-
+
+ //obtain DataSet
+ DataSet ds = parser.parse();
+
+ while (ds.next()){ //loop through file
+ ds.getString("mycolumnName");
+ }
+ </pre></div>
+
</subsection>
<subsection name="Reading Delimited File Column Names In First Record Of File">
<div class="source"><pre>
//Obtain the proper parser for your needs
- PZParser pzparser = DefaultPZParserFactory.getInstance().newDelimitedParser(
- new File("DataFile.txt"), //txt file to parse
+ Parser parser = DefaultParserFactory.getInstance().newDelimitedParser(
+ new FileReader("DataFile.txt"), //txt file to parse
',', //delimiter
'"'); //text qualifier
//obtain DataSet
- DataSet ds = pzparser.parse();
+ DataSet ds = parser.parse();
while (ds.next()){ //loop through file
ds.getString("mycolumnName");
@@ -125,36 +125,36 @@
</pre></div>
</subsection>
-
-
- <subsection name="Reading Fixed Width File">
-
+
+
+ <subsection name="Reading Fixed Width File">
+
<div class="source"><pre>
//Obtain the proper parser for your needs
- PZParser pzparser = DefaultPZParserFactory.getInstance().newDelimitedParser(
+ Parser parser = DefaultParserFactory.getInstance().newDelimitedParser(
new File("map.pzmap.xml"), //fixed with column map
new File("DataFile.txt")); //txt file to parse
-
- //obtain DataSet
- DataSet ds = pzparser.parse();
-
- while (ds.next()){ //loop through file
- ds.getString("mycolumnName");
- }
- </pre></div>
-
- </subsection>
-
- <subsection name="Reading a Message of Fixed Width">
-
- <div class="source"><pre>
-
-... coming soon
-
- </pre></div>
-
- </subsection>
+
+ //obtain DataSet
+ DataSet ds = parser.parse();
+
+ while (ds.next()){ //loop through file
+ ds.getString("mycolumnName");
+ }
+ </pre></div>
+
+ </subsection>
+ <subsection name="Reading a Message of Fixed Width">
+
+ <div class="source"><pre>
+
+... coming soon
+
+ </pre></div>
+
+ </subsection>
+
<subsection name="Using SLF4J With FlatPack">
<div class="source"><pre>
@@ -175,8 +175,8 @@
</subsection>
-
- </section>
-
- </body>
+
+ </section>
+
+ </body>
</document>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|