how to parse an input files that have different types of delimiters
Any one pls help me with ,
How to parse an input file with different types of delimiters (like for example tab delimiter , comma delimiter , tilda delimiter ,caret delimiter etc)
I get an input file which will contain different delimiter (and i dont know which delimiter that is )
How to code this in java .
// FIRST STEP : Here I open the input file and read in record by record
Scanner in = new Scanner(readin);
String input = in.nextLine();
//how should i handle the delimiter and get the data ????
examples of input files :-
file 1 :-
in this file ---record 1 to n --- we see comma as delimiter and double quotes which i should take care to get the data and also " should be taken care .
column = 2000
column = 2020
column = 100
column = 300
I am getting the data in array.
file 2 :-
2000 2020 100 300
in this file --- record 1 to n -- we see tab as delimiter . How to take care to get the data in the array
file 3 :-
file 4 :-
in this file | is the delimiter and also i should take care to omit ' and just get the data 2020 into column
Pls help me in handling diiferent input files with plain java for different delimiters .