943,608 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Marked Solved
  • Views: 4716
  • Java RSS
Sep 17th, 2007
0

Extract columns from text file

Expand Post »
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
Similar Threads
Reputation Points: 8
Solved Threads: 0
Junior Poster
KimJack is offline Offline
114 posts
since Apr 2006
Sep 18th, 2007
0

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
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 871
Code tags enforcer
peter_budo is offline Offline
6,653 posts
since Dec 2004
Sep 18th, 2007
0

Re: Extract columns from text file

Thanks peter_budo
I will try that
Reputation Points: 8
Solved Threads: 0
Junior Poster
KimJack is offline Offline
114 posts
since Apr 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: General error
Next Thread in Java Forum Timeline: debugging JNI application





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC