You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Emmanuel Bourg (JIRA)" <ji...@apache.org> on 2016/03/25 11:41:25 UTC

[jira] [Commented] (CSV-174) Adding methods to support JSON-CSV interchangeability and adding a class/methods to support direct cell modification

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

Emmanuel Bourg commented on CSV-174:
------------------------------------

Hi Joey and thank you for the feedback. That makes a lot of points for a single JIRA issue, it would have been better to discuss this on the mailing list first, and then open one issue per topic.

1. More feedback on the parsing errors in a good idea

2. JSON integration is out of the scope of Commons CSV in my opinion

3. CSVFile is an Interesting idea. What's your use case? I'm not sure to see why one would want to manipulate CSV data instead of an object model or a database later exported to CSV though.

> Adding methods to support JSON-CSV interchangeability and adding a class/methods to support direct cell modification
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CSV-174
>                 URL: https://issues.apache.org/jira/browse/CSV-174
>             Project: Commons CSV
>          Issue Type: Improvement
>          Components: Build
>            Reporter: Joey Pinto
>              Labels: gsoc2016
>
> I wish to introduce some major features in the Commons CSV that I found really necessary while dealing with CSV file parsing requirements of an ERP for a University.
> 1.Custom Exceptions:
>   Exceptions to be raised when incorrectly formatted CSVs are parsed specifying the row number mentioning reasons like incorrect number of columns.
> 2. Export to JSON:
> PostgreSQL Supports direct import of JSON Code. So to insert data from a CSV into the database I had to first convert it to JSON and then make the insert. If we could have an option to do this directly it would be a lot more time saving.
> 3.New Class CSVFile
> I wish to introduce a new class CSVFile which shall have the entire contents of the CSV stored in nested Array Lists.
> I shall have the following methods in the class:
> Constructors:
> void CSVFile(CSVParser);
> void CSVFile(Object [][],boolean has_headers);
> void CSVFile(JSON Array,boolean allow_blanks);
> void CSVFile(String text,String cell_delimiter,String line_delimiter,boolean force_headerSchema);
> Printers:
> String CSVFile.toString();
> JSONArray CSVFile.toJSONArray();
> Object[][] CSVFile.toArray();
> ResultSet CSVFile.toResultSet();
> ArrayList<Object[]> CSVFile.toArrayList();
> ArrayList<ArrayList<Object>> CSVFile.toNestedArrayList();
> String CSVFile.toString();
> Access:
> CSVFile.setColumnHeader(int col_number);
> String CSVFile.getCell(int row_number,String header);
> String CSVFile.getCell(int row_number,int col_number);
> CSVFile.setCell(int row_number,int col_number,String value);
> CSVFile.setCell(int row_number,String header,String value);
> CSVFile.getRowArray();
> JSONObject CSVFile.getRowJSON();
> Sorting:
> CSVFile.sort(Comparator());
> Extraction:
> CSVFile CSVFile.getColumns(Arraylist<String> headers);
> CSVFile CSVFile.getRows(extractor());
> @override 
> public boolean include(CSVRecord record){
> //if satisfies Condition then include
>       return true;
> //else return false
>    }
> Delete:
> void CSVFile.removeRow(int row_number);
> void CSVFile.remove Section(int start_row,int end_row);
> void CSVFile.CSVFile.removeRows(extractor());
> void CSVFile.removeColumn(int col_number);
> void CSVFile.removeColumn(String header);



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)