Peter Read

Greenhorn
+ Follow
since Apr 21, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Peter Read

ok thats very helpful,
I'll go into alittle more detail i have a file which contains numbers i read them and then they go into a int file.
what i need to do is to setup a statement that reads the file and then counts down it and splits it into groups.
Im not sure if the Int is an array though i need to know if that makes a different or not?
the Int file is called submark and i know it contains the numbers because when i outprint it comes up with all the numbers. What i really need is to get the loop working for 0 <10 once ive got that i can do the rest of them.
Any help would be so so so so greatly approved its really this is getting me very stressed.
You can see from my original code what i have so far the while i think means to go through 89 becuase there are 89 numbers in the file
19 years ago
Heres the senario I have alot of Int values that I read from a file, for example:
0,63,12,45,23,56,67,32,56,9,3,0,34
what i need to do is setup a statement where if its less than 10 it will add 1 to a Int called markZero it needs to go round in a big loop and do it till its gone through all the characters.
this is what ive got so far i think its correct but im not sure about the loop its the only thing thats getting it wrong.
19 years ago
Oh dont wurry anymore I found a fix and it works now
19 years ago

Heres my code in brief I have got a file with numbers in it so i used the substring to grab just the ones i needed, However to go further i need to change the string into a Int. I heard about a function called ParseInt so i went to the Sun website and sort of found out how to do it. However its not outputing anything to the screen when i use the System.out.println. Just wondering if anyone has any ideas out there about it. and if you can see if im doing something wrong. Any help would be great
19 years ago
First of all Sorry about the name thing
The other thing,
Just so im getting this correctly

So this means every time i type tokenizer.nextToken(); it will refer to a different column in the file so if i type it 3 times it will go along to the 3rd coloumn and copy that information?
19 years ago
I'd Just like to say thanks to ray and Antoine for the quick replies
As for the code it does work however it displays all the information in the file where as i only need one coloumn of the information,
for example the file is like this
example,example1,example2,example3,example4
example,example1,example2,example3,example4
example,example1,example2,example3,example4
example,example1,example2,example3,example4
example,example1,example2,example3,example4
atm ive got the program to read through and store all this information however i only need the information contained in example3
all the information goes down in sink so there are a set amount of commas between the different points of information. it seems the code supplied by Antoine goes through the whole the file and stores all the information as when i get it to display to the screen it simply displays all of it.
Can i change the current code from Antoine to just store and grab the information i need from example3. Or will i need to use something different?
Any more help would be really greatful
19 years ago
Hello im very new to java, i was wondering whether someone out there could help me with a problem that i have.
I have to get a cetain piece of information out of a .csv file i need to get information from a coloumn in the file. The information that i need is in the same place throughout the file seperated by comma's.
So far ive managed to ope the file and get it to display the information to the screen, Ive been looking for about 2 days for the soloution to this problem but with no luck. I think it can either be solved by reqular expressions or by tokens but i can find a nice simple tutorial to help me.
Im very sorry if this isnt a Beginner subject but to me its really hard, any help on this subject would be very much apreacated.
Oh also i need to store the information so i can put it into a frequency table.
19 years ago