I'm attempting to make my first program that involves file input, but I'm running into problems finding the .txt file.
I placed the file inside the same folder as the rest of the project, but it still doesn't seem to be finding it. Am I doing something wrong? -
-
try
-
{
-
in = new Scanner(new File("File Reading.txt"));
-
String test = in.nextLine();
-
System.out.println(test);
-
}
-
catch(Exception i)
-
{
-
System.out.println("Error: " + i.getMessage());
-
}
-
That's the portion of the code that is supposed to read the file. I cut out the declaration of the Scanner in and the rest of the class, but I figured that wouldn't have anything to do with the problem I'm having.
1 1360
Oh never mind, I figured it out myself.
I still needed to specify the file location in the code.
Feel free to delete this now. :)
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Peter Olcott |
last post by:
www.halting-problem.com
|
by: Fao |
last post by:
Hi, I am in my first year of C++ in college and my professor wants me
to Write a Program with multiple functions,to input two sets of
user-defined data types:
One type named 'Sign' declared by "typedef" to contain only
either +10 or -10 and
the other type named Color declared by "enum" to contain only
black, blue, purple, red, white, and yellow.
|
by: Twan Kennis |
last post by:
Hi,
I have a DB2 database on the IBM iSeries platform, on which I created
several Stored Procedures with the SQLCODE as a return-parameter.
These Stored Procedures are called from a Windows application (build in
Visual Basic) using an ADO/OLE DB Provider on a IBM Client Access ODBC
driver.
On the Internet I found a whitepaper "SQL messages and codes" provided
by IBM which describes a complete list of all SQLSTATEs, SQLCODEs and
|
by: hunter1978 |
last post by:
Hi,
I wonder if somebody could help me. My VB knowledge is limited and I need some help with a VB script an ex member of staff has written.
The script looks at a text file and pulls the infomation into Excel. As far as I can tell the scripts looks for === as the beginning point and then pulls the folling information until it gets to the end of line.
Example:-
=== 22601331 NC MANORD 1624.0 812.00 748.29 0.00 0.00 0.00 0.00 1560.29...
|
by: Shelly |
last post by:
I do what most programmers do -- we steal code from stuff we have written
before, or accept code from others that works, before we attempt to write
something altogether new.
On a previous project I wrote code to upload pictures and music from the
local drive to the server. It worked perfectly. I scarfed that code,
without changing any names, for a new project and I am running into a
problem. Here is what I have:
The form definition:
| |
by: Bill |
last post by:
I'm building a simple file management application using Classic ASP VBScript that has a
form to input page content, and file name.
After the form is submitted, the application will check to see if a page with that file
name already exists - if the file name already exists the user is quickly notified and
asked to provide a different file name for that page.
What I would like to do is, when the user submits the form, if the file name...
|
by: qiong |
last post by:
Dear friends,
Good evening,
I have some problems with finding keyword ":\" for each cell. My objective is to find that keyword in each cell in each worksheet which represent the link. Eg: =+'H:\QC\2007\Quarter 1\EC\Risk Measures'!F14 and paste value it.
I'm using Ms. Excel 2000.
Procedures:
1) Choose the Source_Directory and Source_Name
|
by: =?Utf-8?B?bXVzb3NkZXY=?= |
last post by:
Hi,
I wonder if someone could shed some light on this one for me.
I have developed a web app in VS2005 with the built in server. It uses an
sql database, everytihng works.
I need to test it across the network, so i've installed IIS7 on my Vista
machine and created a new website, point at the website's directory. After I
switched to the 'Classic .net' app pool, it shows up on the port.
|
by: =?Utf-8?B?R1ROMTcwNzc3?= |
last post by:
Hi Guys,
It's been a while, I've got a small problem that I could do with your
expertise on.
As you know (I Think) I build websites for recruitment agencies, part of the
website includes a job board facility and for job form entry I used a normal
form with a normal textbox, however what I'm finding now is that a lot of
recruitment consultants are pasting the job description into the textbox,
which when submitted is resulting in most of...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |