I have to separate a value from a .txt file.
I created a LineNumberReader and used the .split(“\t”) to separate the words, but I only need the second last value (q-value).
Is there an option to specify the .split()?
This is my .txt file
test_id gene_id gene locus sample_1 sample_2 status value_1 value_2 log2(fold_change) test_stat p_value q_value significant
XLOC_000001 XLOC_000001 TC012951 ChLG10:20399-27664 naive BttO NOTEST 0 0.0498691 1.79769e+308 1.79769e+308 0.210754 1 no
You can use the
String#split(String regex, int limit)method, to stop splitting after the column you wish to extract and get the String you want in one line of code: