<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to FAQ</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/</link><description>Recent changes to FAQ</description><atom:link href="https://sourceforge.net/p/opencsv/wiki/FAQ/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 24 Feb 2025 18:18:33 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/opencsv/wiki/FAQ/feed" rel="self" type="application/rss+xml"/><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#15a8/02c4/0565/300e</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;LOL - it is not a death sentence.... But I guess I do understand thinking about it.   I always go to the unit tests for samples but I realized reading my original response that I could because I wrote half of them.   That said the unit tests should be good for part of what you want as they are pretty much stand alone and I am sure there will be test code for the collections.    The downside is you will have to search for it.  &lt;/p&gt;
&lt;p&gt;Consider looking at the CollectionSplitTest.java, JoinTest.java, or FuzzyMappingTest.java. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Conway</dc:creator><pubDate>Mon, 24 Feb 2025 18:18:33 -0000</pubDate><guid>https://sourceforge.net272192b5751b85e81729a48edae879165de6fb42</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#15a8/02c4/0565</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for that Scott.  I will have a dig around.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Doug Merrett</dc:creator><pubDate>Mon, 24 Feb 2025 04:51:02 -0000</pubDate><guid>https://sourceforge.net71f021328e14964a0f8cc4820dee0c38cff61ee0</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#15a8/02c4</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hello Doug - So there are two sources of examples you can look through other than the documentation (https://opencsv.sourceforge.net/#collection_based_bean_fields_one_to_many_mappings).  One is the unit tests - just clone the repo (https://sourceforge.net/p/opencsv/source/ci/master/tree/) and search through the existing unit tests and integration tests and I am sure there will be samples of what you are looking for.   The other is searching or asking on stack overflow (https://stackoverflow.com/search?tab=newest&amp;amp;q=opencsv&amp;amp;searchOn=3) - search first then ask.   &lt;/p&gt;
&lt;p&gt;But as for making any additions to the documentation just for clarification puroposes will be a long time coming because of limitations on time and resources.  &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Conway</dc:creator><pubDate>Sun, 23 Feb 2025 21:15:38 -0000</pubDate><guid>https://sourceforge.net0c3017cbbdee4107370bc82d8a854c8f8da92d3f</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#15a8</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi folks, may I ask a favour?  Your samples directory in the source area is very, very light on in the way of code.  There is only one simple example and the snippets in the documentation do not compile correctly.  I fully understand I am a java newbie, however I learn by reading and have tried many other sites trying to get a bean reader working.  Could you please post the complete code used for the snippets in the &lt;em&gt;Collection-based bean fields (one-to-many mappings)&lt;/em&gt; area of the doc?  Preferably, complete code for all the example snippets.  I am sure there are many others out there that would also appreciate it. Thanks...  &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Doug Merrett</dc:creator><pubDate>Thu, 20 Feb 2025 05:23:05 -0000</pubDate><guid>https://sourceforge.neta73271289b5e0b0f85a5014d49f77324d3ff60bf</guid></item><item><title>FAQ modified by Scott Conway</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -34,3 +34,5 @@

 Another possibility is to try another csv library.   I checked apache commons csv and super-csv and apache does not convert to beans but super-csv does using only reflection.  

+# I am getting an error when using the CSVParser
+Unless you are dealing with custom csv files my default recommendation is to switch over to the RFC4180Parser.    The CSVParser was the original parser for opencsv and predates the RFC4180 specification.   It is made for a high degree of customization but there exist data that it, even with all its customizations, it cannot parse.    If the data does follow the RFC4180 specification then use the RFC4180Parser - it will be a lot easier to set up and parse.    
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Conway</dc:creator><pubDate>Sun, 05 Nov 2023 23:47:32 -0000</pubDate><guid>https://sourceforge.net3ac9ddc60da45df698c5de825daaeeed62817b2f</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#f72f/206f</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The only thing I can think of offhand is to have a finally statment in the try catch where you flush the writer.   &lt;/p&gt;
&lt;p&gt;finally {&lt;br/&gt;
   csvWriter.flush();&lt;br/&gt;
   }&lt;/p&gt;
&lt;p&gt;though in you code you should probably put it between the writeAll and the getByteCount to force the count to be correct.. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Scott Conway</dc:creator><pubDate>Mon, 06 Jun 2022 05:47:31 -0000</pubDate><guid>https://sourceforge.netb91670e1acfe454a5c88187bf633eb00af409fd6</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#f72f</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
CSVWriter is not writing all the data from the resultset, It is breaking in between. In my resultSet have 2200 record but the csv file is generate only 1401 record, it is breaking in between.&lt;br/&gt;
This is intimetent issue, some time it writes whole data and some time its break in between.&lt;br/&gt;
I am using StreamingResponseBody with below code:&lt;/p&gt;
&lt;p&gt;private double writeToOutputStreamUsingCSVWriter(OutputStream outputStream, ResultSet resultSet,&lt;br/&gt;
    DownloadMaster downloadMaster) {&lt;br/&gt;
  double totalBytes = 0;&lt;/p&gt;
&lt;p&gt;if (Objects.nonNull(outputStream) &amp;amp;&amp;amp; Objects.nonNull(resultSet)) {&lt;br/&gt;
    try (CountingOutputStream counterStream = new CountingOutputStream(outputStream);&lt;br/&gt;
        BufferedWriter bufferedWriter = new BufferedWriter(new OutputStreamWriter(counterStream));&lt;br/&gt;
        CSVWriter csvWriter = new CSVWriter(bufferedWriter)) {&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb nb-Type"&gt;int&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;csvTotalRecord&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;csvWriter&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;writeAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resultSet&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;info&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"ResultSet writing is completed, csvTotalRecord are : {}, request key  : {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;csvTotalRecord&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;downloadMaster&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;

&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;totalBytes&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;counterStream&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getByteCount&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;

&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;catch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ClientAbortException&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;NullPointerException&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Client abort error while writing to output stream : {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;downloadMaster&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;catch&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Exception&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nb"&gt;log&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Error while writing to output stream : {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;downloadMaster&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getId&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;}&lt;br/&gt;
  return totalBytes;&lt;br/&gt;
}&lt;/p&gt;
&lt;p&gt;Could you please help me.&lt;br/&gt;
Thanks.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Sanjay</dc:creator><pubDate>Wed, 01 Jun 2022 07:23:54 -0000</pubDate><guid>https://sourceforge.netd68c0c29fde95cb382b535c3e3f3005a6b06f253</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#a2b0/c04e</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Would you please open a regular ticket for this and include:&lt;br/&gt;
1. Code, and&lt;br/&gt;
2. Data?&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andrew Rucker Jones</dc:creator><pubDate>Wed, 17 Mar 2021 18:50:52 -0000</pubDate><guid>https://sourceforge.netc84db5aa4f713aa1b666c7c455d3a45066ecd464</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#a2b0</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Good morning,&lt;br/&gt;
I want to use CSVWriter or CSVParserWriter to output the file in .csv format (as opposed a .txt, etc). When I look at the .csv file, I want the file to have leading 0s (no converstion of any of my ctring arrays to number.  So if I output the following:&lt;br/&gt;
String[] array = {"0000001", "02345698", "120", "3" , "10"};&lt;br/&gt;
I should see the following cells in my .csv file:&lt;br/&gt;
0000001         02345698            120                     3                     10&lt;br/&gt;
currenlty, using writer, I get the following:&lt;br/&gt;
1            2345698            120                   3                         10&lt;/p&gt;
&lt;p&gt;Please help, thank you&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Juan Manuel Buendia</dc:creator><pubDate>Wed, 17 Mar 2021 18:27:04 -0000</pubDate><guid>https://sourceforge.net540ab0077cf89e2702a72945fb869ca7fb10baab</guid></item><item><title>Discussion for FAQ page</title><link>https://sourceforge.net/p/opencsv/wiki/FAQ/?limit=25#198f/1786</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;As many columns as Java can fit in an integer. I think your 1,116 columns are safe.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Andrew Rucker Jones</dc:creator><pubDate>Fri, 22 May 2020 07:31:46 -0000</pubDate><guid>https://sourceforge.net33be809f1479b8cef62b273af482e2a199454966</guid></item></channel></rss>