User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,488 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,738 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1345 | Replies: 2 | Solved
Reply
Join Date: Apr 2006
Posts: 90
Reputation: KimJack is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
KimJack KimJack is offline Offline
Junior Poster in Training

Extract columns from text file

  #1  
Sep 17th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,628
Reputation: peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice peter_budo is just really nice 
Rep Power: 12
Solved Threads: 311
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Extract columns from text file

  #2  
Sep 18th, 2007
  • read the file line by line
  • split the read line on empty character
  • strings received this way store in your arrays
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, JAVAWUG (Java Web User Group), Coding the Architecture
Reply With Quote  
Join Date: Apr 2006
Posts: 90
Reputation: KimJack is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
KimJack KimJack is offline Offline
Junior Poster in Training

Re: Extract columns from text file

  #3  
Sep 18th, 2007
Thanks peter_budo
I will try that
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 3:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC