[jira] [Created] (CSV-214) Adding a placeholder in the Lexer and CSV parser to store the Line Ending

2017-08-10 Thread Nitin Mahendru (JIRA)
Nitin Mahendru created CSV-214:
--

 Summary: Adding a placeholder in the Lexer and CSV parser to store 
the Line Ending
 Key: CSV-214
 URL: https://issues.apache.org/jira/browse/CSV-214
 Project: Commons CSV
  Issue Type: Improvement
  Components: Parser
Reporter: Nitin Mahendru
Priority: Trivial
 Fix For: Discussion


Hi All,

In my use-case , I have to read a CSV file, Mangle some columns and then write 
out a new csv file with those mangled columns.

I have gone through the parser code and I have found no usable way of getting 
the line ending information from the CSVParser object. The function 
readEndOfLine just consumes End of line whether it is CRLF or LF.

Now that problem is that when I am writing my file back using the CSVPrinter, I 
need to know what line ending my input file was. I could write an external 
function to do that. A better way would be to store that information in the 
CSVParser object and just use it.
To do that I am just saving the state in a variable and exposing that using a 
getter.

I have done some basic testing. and Submitting a pull request regarding that.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CSV-214) Adding a placeholder in the Lexer and CSV parser to store the Line Ending

2017-08-10 Thread Nitin Mahendru (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16122354#comment-16122354
 ] 

Nitin Mahendru commented on CSV-214:


That would mean a badly formatted file which needs to be corrected in the first 
place.
Although what would happen is that the line ending in the first line will be 
considered as absolute and final.

> Adding a placeholder in the Lexer and CSV parser to store the Line Ending
> -
>
> Key: CSV-214
> URL: https://issues.apache.org/jira/browse/CSV-214
> Project: Commons CSV
>  Issue Type: Improvement
>  Components: Parser
>Reporter: Nitin Mahendru
>Priority: Trivial
> Fix For: Discussion
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Hi All,
> 
> In my use-case , I have to read a CSV file, Mangle some columns and then 
> write out a new csv file with those mangled columns.
> I have gone through the parser code and I have found no usable way of getting 
> the line ending information from the CSVParser object. The function 
> readEndOfLine just consumes End of line whether it is CRLF or LF.
> Now that problem is that when I am writing my file back using the CSVPrinter, 
> I need to know what line ending my input file was. I could write an external 
> function to do that. A better way would be to store that information in the 
> CSVParser object and just use it.
> To do that I am just saving the state in a variable and exposing that using a 
> getter.
> I have done some basic testing. and Submitting a pull request regarding that.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CSV-214) Adding a placeholder in the Lexer and CSV parser to store the Line Ending

2017-08-10 Thread Nitin Mahendru (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16122360#comment-16122360
 ] 

Nitin Mahendru commented on CSV-214:


pull request raised.

> Adding a placeholder in the Lexer and CSV parser to store the Line Ending
> -
>
> Key: CSV-214
> URL: https://issues.apache.org/jira/browse/CSV-214
> Project: Commons CSV
>  Issue Type: Improvement
>  Components: Parser
>Reporter: Nitin Mahendru
>Priority: Trivial
> Fix For: Discussion
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Hi All,
> 
> In my use-case , I have to read a CSV file, Mangle some columns and then 
> write out a new csv file with those mangled columns.
> I have gone through the parser code and I have found no usable way of getting 
> the line ending information from the CSVParser object. The function 
> readEndOfLine just consumes End of line whether it is CRLF or LF.
> Now that problem is that when I am writing my file back using the CSVPrinter, 
> I need to know what line ending my input file was. I could write an external 
> function to do that. A better way would be to store that information in the 
> CSVParser object and just use it.
> To do that I am just saving the state in a variable and exposing that using a 
> getter.
> I have done some basic testing. and Submitting a pull request regarding that.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (CSV-214) Adding a placeholder in the Lexer and CSV parser to store the end-of-line string

2017-08-11 Thread Nitin Mahendru (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16124099#comment-16124099
 ] 

Nitin Mahendru commented on CSV-214:


Thanks. Will close this ticket.

> Adding a placeholder in the Lexer and CSV parser to store the end-of-line 
> string
> 
>
> Key: CSV-214
> URL: https://issues.apache.org/jira/browse/CSV-214
> Project: Commons CSV
>  Issue Type: Improvement
>  Components: Parser
>Reporter: Nitin Mahendru
>Assignee: Gary Gregory
>Priority: Trivial
> Fix For: 1.5
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Hi All,
> 
> In my use-case , I have to read a CSV file, Mangle some columns and then 
> write out a new csv file with those mangled columns.
> I have gone through the parser code and I have found no usable way of getting 
> the line ending information from the CSVParser object. The function 
> readEndOfLine just consumes End of line whether it is CRLF or LF.
> Now that problem is that when I am writing my file back using the CSVPrinter, 
> I need to know what line ending my input file was. I could write an external 
> function to do that. A better way would be to store that information in the 
> CSVParser object and just use it.
> To do that I am just saving the state in a variable and exposing that using a 
> getter.
> I have done some basic testing. and Submitting a pull request regarding that.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (CSV-214) Adding a placeholder in the Lexer and CSV parser to store the end-of-line string

2017-08-11 Thread Nitin Mahendru (JIRA)

 [ 
https://issues.apache.org/jira/browse/CSV-214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nitin Mahendru closed CSV-214.
--

Code has been merged to master and has been verified.

> Adding a placeholder in the Lexer and CSV parser to store the end-of-line 
> string
> 
>
> Key: CSV-214
> URL: https://issues.apache.org/jira/browse/CSV-214
> Project: Commons CSV
>  Issue Type: Improvement
>  Components: Parser
>Reporter: Nitin Mahendru
>Assignee: Gary Gregory
>Priority: Trivial
> Fix For: 1.5
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Hi All,
> 
> In my use-case , I have to read a CSV file, Mangle some columns and then 
> write out a new csv file with those mangled columns.
> I have gone through the parser code and I have found no usable way of getting 
> the line ending information from the CSVParser object. The function 
> readEndOfLine just consumes End of line whether it is CRLF or LF.
> Now that problem is that when I am writing my file back using the CSVPrinter, 
> I need to know what line ending my input file was. I could write an external 
> function to do that. A better way would be to store that information in the 
> CSVParser object and just use it.
> To do that I am just saving the state in a variable and exposing that using a 
> getter.
> I have done some basic testing. and Submitting a pull request regarding that.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (CSV-215) CSVRecord mutability

2017-08-15 Thread Nitin Mahendru (JIRA)
Nitin Mahendru created CSV-215:
--

 Summary: CSVRecord mutability
 Key: CSV-215
 URL: https://issues.apache.org/jira/browse/CSV-215
 Project: Commons CSV
  Issue Type: Improvement
  Components: Parser
Reporter: Nitin Mahendru
Priority: Minor


I recently pushed a change(pull request 20) to get the line ending from the 
parser.

Now I want to push another change which I feel will also be useful for the 
community. I want to add a CSVRecordMutable class which had a constructor which 
accepts a CSVRecord object. So when we have a CSVRecordMutable object from it 
then we can edit individual columns using it.

I would be using this to write back my edited CSV file. My use case is to read 
a csv, mangle some columns, write back a new csv.

I could have directly raised a pull request but I just wanted to float the idea 
before and see the reaction.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)