Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0D2EF18B7A for ; Fri, 7 Aug 2015 01:51:46 +0000 (UTC) Received: (qmail 14274 invoked by uid 500); 7 Aug 2015 01:51:45 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 14165 invoked by uid 500); 7 Aug 2015 01:51:45 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 14152 invoked by uid 99); 7 Aug 2015 01:51:45 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2015 01:51:45 +0000 Date: Fri, 7 Aug 2015 01:51:45 +0000 (UTC) From: "Jason Steenstra-Pickens (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CSV-155) Get remaining unformatted text MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CSV-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jason Steenstra-Pickens updated CSV-155: ---------------------------------------- Description: I have the requirement where I need to parse the headers of a CSV string so that I can validate them and then remove those headers. The problem is that the CSVParser creates an internal ExtendedBufferedReader from the given reader (which in my case is a StringReader). Reading the first record will read and buffer additional records so if I then try and read directly from the StringReader it does not return anything. To solve this I need to be able to do one of the following: # pass in my own ExtendedBufferedReader (so would need to be made public) # have a new getter method to be able to retrieve the internal ExtendedBufferedReader (or as a BufferedReader, either will do) # have a new method on the CSVParser to be able to retrieve the remaining raw records. The current workaround is to read all the records and then write all the records except the first back out to a StringWriter but this is a lot of unnecessary work and code. This doesn't really work since it reader and writing it back out has a very high chance of modifying the quotes, escapes, whitespace etc. was: I have the requirement where I need to parse the headers of a CSV string so that I can validate them and then remove those headers. The problem is that the CSVParser creates an internal ExtendedBufferedReader from the given reader (which in my case is a StringReader). Reading the first record will read and buffer additional records so if I then try and read directly from the StringReader it does not return anything. I either need to be able to pass in my own ExtendedBufferedReader (so would need to be made public) or have a new method on the CSVParser to be able to retrieve the remaining raw records. The current workaround is to read all the records and then write all the records except the first back out to a StringWriter but this is a lot of unnecessary work and code. This doesn't really work since it reader and writing it back out has a very high chance of modifying the quotes, escapes, whitespace etc. > Get remaining unformatted text > ------------------------------ > > Key: CSV-155 > URL: https://issues.apache.org/jira/browse/CSV-155 > Project: Commons CSV > Issue Type: New Feature > Components: Parser > Affects Versions: 1.1 > Reporter: Jason Steenstra-Pickens > > I have the requirement where I need to parse the headers of a CSV string so that I can validate them and then remove those headers. > The problem is that the CSVParser creates an internal ExtendedBufferedReader from the given reader (which in my case is a StringReader). Reading the first record will read and buffer additional records so if I then try and read directly from the StringReader it does not return anything. > To solve this I need to be able to do one of the following: > # pass in my own ExtendedBufferedReader (so would need to be made public) > # have a new getter method to be able to retrieve the internal ExtendedBufferedReader (or as a BufferedReader, either will do) > # have a new method on the CSVParser to be able to retrieve the remaining raw records. > The current workaround is to read all the records and then write all the records except the first back out to a StringWriter but this is a lot of unnecessary work and code. This doesn't really work since it reader and writing it back out has a very high chance of modifying the quotes, escapes, whitespace etc. -- This message was sent by Atlassian JIRA (v6.3.4#6332)