![]() |
| ||
| tab separated file 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? |
| ||
| Re: tab separated 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. |
| ||
| Re: tab separated file the file is tab separated into three sections. section1 section2 section3 i only want to read section2 |
| ||
| Re: tab separated file Then use String.split() to separate it and read the second element of the result. |
| ||
| Re: tab separated file array is an arraylist<string> for (int i = 0; i<array.size(); i++) i get: [Ljava.lang.String;@ca0b6 i am supposed to get "10.0.0.2" |
| ||
| Re: tab separated file Did you read the api doc on split() at all? |
| ||
| Re: tab separated file yes and according to the instructions that is how u should use it. |
| ||
| Re: tab separated file Really? Because this particular part would seem to be clearly saying something else Quote:
(Also, there does not appear to be anyone named "u" here at the moment. Use proper English.) |
| ||
| Re: tab separated file 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. |
| ||
| Re: tab separated file 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. |
| All times are GMT -4. The time now is 6:46 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC