Java CSV String Split getContentsFromNumpyCSVString( String numpyString)

Here you can find the source of getContentsFromNumpyCSVString( String numpyString)

Description

get Contents From Numpy CSV String

License

Open Source License

Declaration

public static List<String[]> getContentsFromNumpyCSVString(
            String numpyString) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<String[]> getContentsFromNumpyCSVString(
            String numpyString) {
        ArrayList<String[]> contents = new ArrayList<>();
        String[] lines = numpyString.split("\n");

        for (int i = 0; i < lines.length; i++) {

            contents.add(lines[i].split(","));
        }// w ww .  j  a  v a2s.co m
        //System.out.println("Contents rows: " + contents.size());
        //System.out.println("Contents columns: " + contents.get(0).length);
        return contents;
    }
}

Related

  1. csvSplit(String csvLine)
  2. csvToArray(String s)
  3. csvToTrimArray(CharSequence charsequence)
  4. getCsvValues(String line)
  5. getValuesFromCSVString(String csvString)
  6. SplitCSV(String csv)
  7. splitCSV(String inputString)