DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Extract columns from text file (http://www.daniweb.com/forums/thread89920.html)

KimJack Sep 17th, 2007 9:38 pm
Extract columns from text file
 
Hello all,

I have a text file with columns of words

Boat Car Van
Sue Bird Hue
Billy Don Yoe...

How do I read each separate column into separate arrays.

Array 1 will read:
Boat
Sue
Billy

Array 2 will read:
Car
Bird
Don...

Any suggestions on how to accomplish this.

Thanks

peter_budo Sep 18th, 2007 8:04 am
Re: Extract columns from text file
 
  • read the file line by line
  • split the read line on empty character
  • strings received this way store in your arrays

KimJack Sep 18th, 2007 10:21 am
Re: Extract columns from text file
 
Thanks peter_budo
I will try that


All times are GMT -4. The time now is 9:08 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC