Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WSAD - How to read/find text file.

 
John Coxey
Ranch Hand
Posts: 503
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All:
- I am trying to read a simple text file in WSAD v5.0
- Some questions?
1. Does the text file need to be in a *.jar file?
2. Where should I put the text file?
3. What about the classpath? Do I need to set it?
4. What would the line of code look like to be able to find/read the text file?
---------
I've been playing with this for a week now, and the IBM documentation is all over the place on this one.
Any help would be appreciated.
Thanks,
John Coxey
jpcoxey001@yahoo.com
 
Scott Minor
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by John Coxey:
All:
- I am trying to read a simple text file in WSAD v5.0
- Some questions?
1. Does the text file need to be in a *.jar file?
2. Where should I put the text file?
3. What about the classpath? Do I need to set it?
4. What would the line of code look like to be able to find/read the text file?
---------
I've been playing with this for a week now, and the IBM documentation is all over the place on this one.
Any help would be appreciated.
Thanks,
John Coxey
jpcoxey001@yahoo.com

John,
What are you really trying to do. All you need to do is know where the file is and java will open it. I have a program that ftp's a file from a remote location and then opens the "TXT" file and processes it.
 
John Coxey
Ranch Hand
Posts: 503
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott:
- I am trying to read in a Properties file.

- Problem is where do I put the file "somefile.dat"?
- The next problem, how do I set the classpath in WSAD so that I can find "somefile.dat".
- Note: The java program above as well as "somefile.dat" are located in the same WSAD project.
--------
Can anyone answer the above?
Scott, does this help?
Thanks,
John Coxey
jpcoxey001@yahoo.com
 
Sunil Dumpala
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi John,

I am facing a similar problem. I am not sure where to place my properties file. I tried putting it in Project>properties>Java Build Path > Libraries

But with no use. Have you figured out what needs to be done for this? Any help would be appreciated.
Thanks,
Sunil
 
Sunil Dumpala
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind I figured it out. Thanks.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic