Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:48:32+00:00 2026-06-01T20:48:32+00:00

reader = new CSVReader(new FileReader(file.txt)); The file is placed in the same directory as

  • 0
reader = new CSVReader(new FileReader("file.txt"));

The file is placed in the same directory as the java class. Anyhow I get FileNotFoundException.

What is wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:48:34+00:00Added an answer on June 1, 2026 at 8:48 pm

    Relative paths are relative to the current working directory. In your code sample, if file.txt isn’t in your current directory, it won’t be found.

    Be wary of using relative paths in your code. That’s because it’s impossible to tell at compile time what the current working directory will be when your code is run.

    If the file is part of your deployment, store it on the classpath and access it via ClassLoader.getResourceAsStream(), if it’s truly external data that the user can change, put the file name in a configuration of some sort.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So OK if I run this wrong code: csvReader1 = csv.reader(file('new_categories.csv', rU), delimiter=',') for
I have a csv reader class that reads a .csv file and its values....
public void populateNotesFromFile() { try{ BufferedReader reader = new BufferedReader(new FileReader(DEFAULT_NOTES_SAVED)); String fileNotes =
I am unable to fill a typed dataset Using reader as New StringReader(My.Resources.sampledata) typedDataset.ReadXML(reader)
I'm currently building a new online Feed Reader in PHP. One of the features
(Long time reader of SO, first time asking a q. I'm quite new to
So I am using the FileStream inside XmlReader using (XmlReader reader = XmlReader.Create(new FileStream(archivePath,
if screen reader fill any content wrong then how to give info (if javascript
i am opening a csv file like this: import csv reader = csv.reader(open(book1.csv, rb))
im reading a csv file and then writing a new one: import csv with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.