I have a file that is tab separated. i read it in as an arraylist<string> how can i print out only the second section of the file?
That depends what "second section" means. If you can't be more specific than that, you have little chance of getting a program to do something with it.
the file is tab separated into three sections.
section1 section2 section3
i only want to read section2
Then use String.split() to separate it and read the second element of the result.
Did you read the api doc on split() at all?
yes and according to the instructions that is how u should use it.
Really? Because this particular part would seem to be clearly saying something else
the array of strings computed by splitting this string around matches of the given regular expression
Notice the array part.
(Also, there does not appear to be anyone named "u" here at the moment. Use proper English.)
i read it again and i still understand the same thing.
i obiously dont understand how to use it.
can you help me out or not.
It splits on a particular expression, which in your case should be tab, and returns an array of the pieces. If you want the second section then you just need the second element of that array.