Java SE doesn't know about the insides of many types of files.
You will have to
either find a third party package that does know how to make the changes you want to make
or you will need to get documentation for the layout of the contents of the file and write code to add to or update the contents of the file. If you find out what the contents of the file are, then we can help you write the code to change the file.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Look at the Floating-Point Literals section.
I think a literal is what you are calling a constant.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
What did Google give you?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Which of those 4 steps are you working on? Do one at a time: code it, compile and test it.
When it works move to the next one.
When you have problems and want help, post your questions here.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
results[4][5] = i; // problem here nothing gets stored
How do you know? Is the statement executed? It's inside of an if statement.
Add a println immediately after that statement that prints out the value of results[4][5] and the value of i. Then you'll see what was stored in the array.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
That doesn't look like valid java code. var is not part of java.
What happened if I omit the "f" at the end?
If it is java, compile and execute the program and see what happens.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
I'm getting a few errors
You need to post the full text of any error messages that you need help with.
not sure how to continue
To see what is in the token array use the Arrays class's toString() method to format the array for output: System.out.println("an ID "+ java.util.Arrays.toString(theArrayName));
Replace "an ID" with a description of what is being printed.
What does the assignment say you need to do with the tokens that are in the array?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Read the API doc for the packages you are using.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Look at the prinf() method. It has formatting Strings that should help.
Also the String class's format() method could be useful.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Pad the Strings in the first column with spaces so that they are all the same length.
say you want the first column to be 20 characters wide and the String to print is 15 chars long, then you need to add a String of 5 spaces to fill the first column to 20.
Make a method that takes the String and the width of the column and returns a new String with the input String padded with spaces to the width number of characters.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Why not use a loop to copy an element from each array into the target array?
Define the target 2D array and copy to elements 0 and 1
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
a(which is 1)
Can you explain what you mean here? Are you talking about the char value: 'a' or what?
Or are you talking about an int variable named a: int a = 1;
Your discussions are very ambiguous and impossible to follow unless you define the terms you are using.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
wants it to have values a=1 b=2 c=3.
To make f('a') = 1 do this: subtract 'a' and add 1
'a' - 'a' + 1 = 1
'b' - 'a' + 1 = 2
etc
Are you confusing the hexidecimal values of hex digits with the values of chars?
The hex digit A represents the int value 10, B is 11 etc through F = 15
The int value of 'A' is 65
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Comments:
The code is poorly formatted
If key is a String, why do this: key.toString() use key directly
What does this mean: subtracts 9 to make unicode into values A,B,C...=1,2,3...
'A' - 9 = 56 not 1
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
The class won't compile?!
Please post the full text of the error messages.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Can you post what the csv file would look like given the XML you posted for input?
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
What code have you written so far? Do you have any specific problems or questions to ask about it?
Post your code and your questions so we can help you get your code to work.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16
Add just one println statement inside the draw() method (after line 25) that prints the values of all the variables used in the draw() method.
NormR1
Posting Sage
7,742 posts since Jun 2010
Reputation Points: 1,158
Solved Threads: 793
Skill Endorsements: 16