I\'m trying to use
\"value1:value2::value3\".split(\":\");
Problem is that I want it to include the blank results.
It returns:
This works,
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.File;
import java.io.IOException;
public class split {
public static void main(String[] args)
{
String data = null;
try {
BufferedReader br = new BufferedReader(new FileReader(new File("split.csv")));
while( (data=br.readLine())!=null)
{
System.out.println("line:"+data);
String[] cols = data.split(":",-1);
System.out.println("count:"+cols.length);
for(int x=0;x
Here is a test file,
a:b:c:d:e
a:b:c:d:
a:b:c::
a:b:::
a::::
::::
::::e
:::d:e
::c:d:e
:b:c:d:e
a:b:c:d:e