Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Java reading text file
New Posts  All Forums:Forum Nav:

Java reading text file

post #1 of 3
Thread Starter 
I'm working on a programming project and for the life of me, i can't get java to find the .txt file i want it to use.

I'm using eclipse in windows. I have the workspace setup in E:\\Java\\Workspace

One thing i'm kinda confused about is what is the current directory?
Is that the workspace directory?

I've tried putting the .txt file in \\Project2\\ (Project2 is the name of my programming project), and i've tried putting the .txt file in \\Project2\\src\\. I've even tried to program in the absolute file location.

I've even gone as far as resetting eclipse to use it's default directory (C:\\users\\user\\workspace) and that didn't work either.

Can anyone help me figure this out?
Router
(12 items)
 
  
Reply
Router
(12 items)
 
  
Reply
post #2 of 3
All working directories and workspaces aside, don't you have the actual Reader referencing a location? It's usually most efficient to create an InputStream and load the file into that.

Can we see your code?
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
post #3 of 3
Thread Starter 
nevermind, i figured out what i needed.

I used the getCanonical() on a file object, and also have a way to replace \\ with / so that it find the file.
Router
(12 items)
 
  
Reply
Router
(12 items)
 
  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Java reading text file