Hello everyone,

I am writing a program that will read data from a txt file and for the life of me I cannot get it to do so ... Seems like no matter what ! I do it keeps telling me it cannot find the file .. I have used everything I can find in my textbook and just for test sake have copy and pasted prewritten code off of the internet and still NOTHING !!!! ahhhhhh !!!

I have a Mac .. do I need to specify the entire file pathway >???? if so ,, or whatever the solution is .. can someone PLEASE show me how to state this file name so my program will pick it up ? THis is greatly appreciated ,, I have been trying for hours to just get it to recognize a file and it will not ...

C-

Yeah, just specify the entire file path. You can also look into how to use getResource() but it can be difficult.

Hello everyone,

I am writing a program that will read data from a txt file and for the life of me I cannot get it to do so ... Seems like no matter what ! I do it keeps telling me it cannot find the file .. I have used everything I can find in my textbook and just for test sake have copy and pasted prewritten code off of the internet and still NOTHING !!!! ahhhhhh !!!

I have a Mac .. do I need to specify the entire file pathway >???? if so ,, or whatever the solution is .. can someone PLEASE show me how to state this file name so my program will pick it up ? THis is greatly appreciated ,, I have been trying for hours to just get it to recognize a file and it will not ...

C-

Ok .. thank you for the reply .. I appreciate it ..

Yeah, just specify the entire file path. You can also look into how to use getResource() but it can be difficult.

Thanks for replying .. now I just need to figure out how to properly express the path .. lol ... its been one of those days ....

Thanks again

Colin

If you're in the terminal type "pwd" and then you'll know the file's pathname. Or you can navigate to the file's location and click properties on it and view the entire file path and copy paste it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.