I have a feeling it is something simple troubling me, I just cant find out what that problem is. The progam is SO CLOSE! please help me. - public class BubbleSort2
-
{
-
public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
String linetext;
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
filage=inWords.readLine();
-
-
while((linetext=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
}
that little bit is the problem, I can compile and run, but it only executes the first line of the file and asks for the file again, then does the first line AGAIN and asks for the file AGAIN and so on and so forth repeating untill I terminate the box. If you have any suggestions, me and my friend are having the same problem, thanks for your time,
Steve
14 2507
I have a feeling it is something simple troubling me, I just cant find out what that problem is. The progam is SO CLOSE! please help me. - public class BubbleSort2
-
{
-
public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
String linetext;
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
filage=inWords.readLine();
-
-
while((linetext=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
}
that little bit is the problem, I can compile and run, but it only executes the first line of the file and asks for the file again, then does the first line AGAIN and asks for the file AGAIN and so on and so forth repeating untill I terminate the box. If you have any suggestions, me and my friend are having the same problem, thanks for your time,
Steve
This is only ossible if you have print out in the sort method which you decided not to post. Please post the whole class.
This is only ossible if you have print out in the sort method which you decided not to post. Please post the whole class.
I was wondering if you coult do the "String Data=inData.readLine(Counter);" to read each line and just bump it up but it said it couldn't resolve the symbol, I pretty much am out of guesses at this point.
I was wondering if you coult do the "String Data=inData.readLine(Counter);" to read each line and just bump it up but it said it couldn't resolve the symbol, I pretty much am out of guesses at this point.
What do you want the lines -
-
String filage="";
-
String linetext;
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
filage=inWords.readLine();
-
-
while((linetext=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
-
to do?
I want them to find the data file inputted at the command prompt and run the program for each line with the while statement
I want them to find the data file inputted at the command prompt and run the program for each line with the while statement
Then
should be - public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
-
-
while((filage=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
-
}
^^^^
that gives the same repeating results
- public static void main (String args[]) throws Exception
-
{
-
String filage="";
-
-
BufferedReader inWords=new BufferedReader(new InputStreamReader(System.in));
-
System.out.println("Please input the name of the file from which the data will be acquired. Be sure to use the entire path.");
-
-
-
while((filage=inWords.readLine())!=null)
-
{
-
Sort(filage);
-
}
-
-
}
^^^^
that gives the same repeating results
So filage is actually a line of data from your file.
Now have a look at - Data=seekBufferedReaderData(filage);
-
.
And that method takes the fileage and tries to open a file called filage!
sorry, I dont follow. I just want to fill an array with each subscript being a different line of the test values
EX.
1.) 2 3 4 5
2.) 3 6 2 6
3.) 9 2 5 6
i want NumberArray[0]==2 3 4 5 and NumberArray[1]==3 6 2 6, etc etc. I think I can work it out if I can get some direction on that.
sorry, I dont follow. I just want to fill an array with each subscript being a different line of the test values
EX.
1.) 2 3 4 5
2.) 3 6 2 6
3.) 9 2 5 6
i want NumberArray[0]==2 3 4 5 and NumberArray[1]==3 6 2 6, etc etc. I think I can work it out if I can get some direction on that.
- index = 0;
-
for each line in the file
-
String[] two = line.split(")"); // or is it line.split("\\)")?
-
numberArray[index] = two[1];
-
i'm sorry, could you integrate it into my code or some other code for an example of actual coding, I'm not sure based on what you said, thats all new stuff to me...i'm sorry for the inconvenience
Steve
- index = 0;
-
for each line in the file
-
String[] two = line.split(")"); // or is it line.split("\\)")?
-
numberArray[index] = two[1];
-
Do you understand what the above is trying to do?
sorry, I dont follow. I just want to fill an array with each subscript being a different line of the test values
EX.
1.) 2 3 4 5
2.) 3 6 2 6
3.) 9 2 5 6
i want NumberArray[0]==2 3 4 5 and NumberArray[1]==3 6 2 6, etc etc. I think I can work it out if I can get some direction on that.
Is the data in your file numbered like the example above or is the data just like this
2 3 4 5
3 6 2 6
9 2 5 6
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Avi Schwartz |
last post by:
In this issue the following statement is made:
"In plpgsql, you cannot run a dynamic SELECT statement and be able to
do anything with the selected data. You cannot assign the selected
value to a...
|
by: Danny J. Lesandrini |
last post by:
The following code works with a standard MDB to navigate
to a particluar record (with a DAO recordset, of course)
but it's giving me problems in an ADP I'm working on.
Dim rs As ADODB.Recordset...
|
by: Eric |
last post by:
I'm looking at this page in the MSDN right here:
ms-help://MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemcollectionsarraylist
classsynchronizedtopic2.htm
(or online here:...
|
by: IntraRELY |
last post by:
I have a loop that loops through this sub. However, I recieve an
WebException error in my try statement. "An exception occurred during a
WebClient request." This message doesnt happen when I am...
|
by: Mrinal Kamboj |
last post by:
Hi ,
I am confused that's is not even correctly mentioned in MSDN , if my
code snippet works , have a look at this :
1. string s = {"1", "2","3"} ;
foreach(string ss in s)
{
ss = "4" ; //...
|
by: matchine |
last post by:
This is a recommendation based on my research on an issue with the
transfer text functionality. The comments below were from a tech I
approched for help.
"The transfer text process blocked...
|
by: ataanis |
last post by:
Hi,
I have the following statement, and i'm trying to understand why when
I do the second print it's giving me segmentation fault, both name
and s_aliases are char arrays e.g
THE FIRST PRINT...
|
by: Ryan |
last post by:
Hello. I was hoping that someone may be able to assist with an issue
that I am experiencing. I have created an Access DB which imports an
Excel File with a particular layout and field naming. ...
|
by: Kelii |
last post by:
I've been trying to get this piece to work for a few hours, but have
given up. I hope someone out there can help, I think the issue is
relatively straightforward, but being a novice, I'm stumped....
|
by: pmlane2001 |
last post by:
I have a PHP SOAP XML file size problem that I was wondering if anyone has seen before. I have an XML file that when I put it through my PHP script with 270 lines (13,082 KB) it works fine. If I...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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...
|
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,...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |