Storing Numbers in a File

I have a problem storing numbers in files. WHen i store them, they are stored as ANSI numbers. Which means I have a limit of 255. Anything over this becomes a '?'
How would I go about getting around this limitation?
Should I store them as strings?

If you have a string which contains only a number, you can use the following method to get the number:
String s="123";
int i=Integer.parseInt(s);So you could store one number per line in the file, which is the simplest way to do it.
Alternatively, you can store several numbers on each line, so long as they are separated by the same character, eg a space, or a comma or whatever. The use StringTokenizer to break the string up into tokens according to the delimeter you specify:
String s="1,2,3,4,5,6";
StringTokenizer st=new StringTokenizer(s, ",");
while (st.hasMoreTokens()) {
  //This loop iterates over each token. Basically, each time this
  //loop goes round, i equals the next number in the string.
  int i=st.nextToken();
}So you can store numbers however you like in the file, so long as the numbers are all stored in the same way (this keeps it simple).

Similar Messages

  • Is there a way to change the image numbers in a file in Aperture?

    Is there a way to change the image numbers in a file in Aperture? We shoot with two photographers and so the img numbers are not in order but I would like to have the photos in chronological order on the disc when I give it to them. Does anyone know how to do this? I have them all in order ready to go in Aperture but when I move them to the disc to be burned they default back to the img number order. Thanks for your help!

    What do you mean by "image number"? The file names like "IMG_7822.CR2" or "IMG_7822.jpg"?
    You can create custom names with appended numbers, when you export your image files to be saved on a disk.
    Sort your images by date in the browser, select them, then use the command "File > Export > Version" to write the files to the disk. Set the name format to "Custem Name with Index" or "Custom Name with Counter" to create numbered names in your current sort order.
    Regards
    Léonie

  • Error while executing Multiple Stored Procedure through .sql file

    Hi Guru's.
    I am new to ORACLE. I am facing problem while creating Stored Procedure through .sql file.
    I have one test.sql file with Stored Procedure is like,
    CREATE OR REPLACE PROCEDURE skeleton1
    AS
    BEGIN
         DBMS_Output.Put_Line('skeleton1');
    END skeleton1;
    CREATE OR REPLACE PROCEDURE skeleton2
    AS
    BEGIN
         DBMS_Output.Put_Line('skeleton2');
    END skeleton2;
    Now when i try to execute this test.sql file through SQL PLUS it gives me Error like this
    I am opening test.sql file from SQL PLUS,
    SQL>
    1 CREATE OR REPLACE PROCEDURE skeleton1
    2 AS
    3 BEGIN
    4 DBMS_Output.Put_Line('skeleton1');
    5 END skeleton1;
    6 /
    7 CREATE OR REPLACE PROCEDURE skeleton2
    8 AS
    9 BEGIN
    10 DBMS_Output.Put_Line('skeleton2');
    11* END skeleton2;
    SQL> /
    Warning: Procedure created with compilation errors.
    SQL> show errors;
    Errors for PROCEDURE SKELETON1:
    LINE/COL ERROR
    6/1 PLS-00103: Encountered the symbol "/"
    SQL>
    Please suggest how to create multiple CREATE PROCEDURE using single .sql script file....
    Regards,
    Shatrughan

    Hi,
    Try this
    CREATE OR REPLACE PROCEDURE skeleton1
    AS
    BEGIN
    DBMS_Output.Put_Line('skeleton1');
    END ;
    CREATE OR REPLACE PROCEDURE skeleton2
    AS
    BEGIN
    DBMS_Output.Put_Line('skeleton2');
    END;
    /Save the file and call it.
    Regards,
    Bhushan

  • I purchased Creative design premium 5 in 2011 and have had to resett my new computer and i do not have a disk drive.... I need to download from online and dont know how. my serial numbers are on file in my adobe account

    I own a copy of creative design premium 5 and my new laptop doesnt have a disk drive..... How do I download for site... My serial numbers are on file in my adobe account.... I need to reinstall it to this computer because I have had to reset it. I have tried to download it but it is telling me that I am denied access.

    Download CS5 products
    If you get issues, use another browser and make sure you allow JavaScript and your security tools don't block the page.
    Mylenium

  • HT3350 what can you do when you get this warning? "Scouting Book  Collection Index" could not be handled because Numbers cannot open files in the "Numbers Document" format.

    “Scouting Book  Collection Index” could not be handled because Numbers cannot open files in the “Numbers Document” format.

    This file was created in 2002 in MSword but this had been forgotten.
    When I went to open it.... (MSword) was not a program option on my laptop. For some reason, I assumed that either Pages or Numbers wouild open the file. How the file was created was forgotten and had no file Info, but I new that it was a table of valuable information.
    The warning threw me off, because it led me to believe that it was a Numbers file. which Numbers would not open. A paradox.
    I took the file to a laptop in OSXpanther with MSoffice and it opened in MSword. Problem Solved.
    Thank you for your help.

  • Storing url in text file?

    Hi
    I have 1 buttons in my flash movie. and want to use this swf in some other projects. just this button link will change in each project, so will also the button text. I dont want to edit flash file for each project. Can I use a text file for URL of button and I change text file to edit link of buttons and text of button?
    thanks in advance

    thanks for the information  
    if i skip the button and just have a text witch is also stored in the text file
    in html or somthing, and then show this in a textarea component or something
    is this possible without using xml or anything else thats hard to set up
    thanks again for taking time, flash guru =)

  • Is there way to have Numbers open excel files automatically

    Is there way to have Numbers open excel files automatically when I click on my old excel files rather than opening numbers and then opening file?

    Try this: from Finder, select an Excel file. Hit Apple-i to get the file info. You'll see a section labeled *Open with:* Use the dropdown to select Numbers and click the *Change All* button.

  • How is the connection info stored in a .rpt file?

    I'm writing a set of reports that are going to be distributed to many clients across the country. Each one of them will have a different connection string to use.
    I don't want to have to walk each client through setting the datasource location manually.
    Is there anyway I can have the .rpt file look at a config file or something to change the database/server name to the client's settings rather than remembering the settings I have here?
    Our app has a connection string stored in a text file that I could translate into xml or something else.
    If you need more details let me know.

    Hi,
    Need more info-
    VS version?
    CR version?
    Web or win app?
    Also you can provide the connection information in the web.config file and retrieve the information from their as per the requirement(In case of web application).
    Also you can change the connection informatin in code, but the database structure should be same as the reports been designed.
    To download sample code click [here|https://boc.sdn.sap.com/codesamples].
    You can also take help from [Dev library|https://boc.sdn.sap.com/node/7770]
    Hope this helps!!
    Regards,
    Amit

  • Stored numbers not stored!

    When I call one of my Skype to Go numbers, I am told "we don't recognise the number you are calling from, please jump through 15,000 hoops to connect the call" the number I am calling from is stored in my stored numbers... it gives me the option to save the number again, but the next time I call I have to jump through the same 15,000 hoops, why is this happening?

    Something like
    SELECT row_number() over (order by deptid) rank_no, deptid, dept_name
      FROM deptJustin

  • Unable to open Numbers 3.5 file in Numbers 3.2

    I'm unable to open a Numbers 3.5 file in Numbers 3.2.  My wife has a macbook pro with Maverick and numbers 3.2.  I've created a 3.5 file and sent it over to her. However she cannot open it. Any suggestions?

    Export the file to Numbers '09 format using the menu item "File > Export To > Numbers '09..." then send that file to your wife. 

  • Increment numbers in XML files

    My code is
    public class Main
        private static File fileTmp;
        private static BufferedReader br;
        private static BufferedWriter bw;
        private static String line;
        /** Creates a new instance of Main */
        public Main()
        public static void main(String args[])
            File xmlFile = new File(args[0]);
            File parentPath=new File(xmlFile.getParent(),"files");
            File [] files = parentPath.listFiles();
            for(int i=0;i<files.length;i++)
                File f = new File(files.getAbsolutePath());               
    if(!(f.isDirectory()))
    try
    fileTmp = File.createTempFile(f.getName(), "tmp");           
    br = new BufferedReader(new FileReader(f));
    bw = new BufferedWriter(new FileWriter(fileTmp));
    while((line = br.readLine()) != null)
    if(line.contains("<citation citation-type=\"book\" id=\"\">"))
    line = FunctionToIncrement(line);
    bw.write(line);
    bw.newLine();
    catch(NullPointerException n)
    n.printStackTrace();
    catch(IOException ioe)
    System.out.println("IOException.."+ioe.getMessage());
    finally
    try
    br.close();
    catch(Exception e)
    try
    bw.close();
    catch(Exception e)
    if(f.delete())
    fileTmp.renameTo(f);
    private static String FunctionToIncrement(String line)
    String res = "";
    int num=1;
         res = line.replace("<citation citation-type=\"book\" id=\"\">","<citation citation-type=\"book\" id=\""+num+"\">");          
    System.out.println("res:"+res);
    num++;
    return res;
    Input XML files are
    XML file 1
    <citation citation-type="book" id="">
    <citation citation-type="book" id="">
    <citation citation-type="book" id="">
    <citation citation-type="book" id="">
    XML file 2
    <citation citation-type="book" id="">
    <citation citation-type="book" id="">
    XML file 3
    <citation citation-type="book" id="">
    From the code my Output XML files contain
    XML file 1
    <citation citation-type="book" id="1">
    <citation citation-type="book" id="1">
    <citation citation-type="book" id="1">
    <citation citation-type="book" id="1">
    XML file 2
    <citation citation-type="book" id="1">
    <citation citation-type="book" id="1">
    XML file 3
    <citation citation-type="book" id="1">
    But Ouput XML files should contain incremented numbers as
    XML file 1
    <citation citation-type="book" id="1">
    <citation citation-type="book" id="2">
    <citation citation-type="book" id="3">
    <citation citation-type="book" id="4">
    XML file 2
    <citation citation-type="book" id="1">
    <citation citation-type="book" id="2">
    XML file 3
    <citation citation-type="book" id="3">Could anyone please help me to update my code.

    int cntr=1;   // everytime the for loops goes around, we create cntr = 1
    fileTmp = File.createTempFile(f.getName(), "tmp");                          
    br = new BufferedReader(new FileReader(f));
    bw = new BufferedWriter(new FileWriter(fileTmp));
    while((line = br.readLine()) != null)
      if(line.contains("><citation citation-type=\"book\" id=\"\">"))
           line = FunctionToIncrement(line, cntr);
           cntr++;
      bw.write(line);
      bw.newLine();
    private static String FunctionToIncrement(String line, int cntr)
            String res = "";
         res = line.replace("<citation citation-type=\"book\" id=\"\">","<citation citation-type=\"book\" id=\""+cntr+"\">");          
            System.out.println("res:"+res);
            return res;
    } Or simply make cntr variable global to the class.
    Another way to think about it this:
    Your approach is fine because you are doing the increments and writing on the fly. If your XML was bigger, it wouldn't be all that great.
    Count the number of instances that line occurs (DOM or SAX). Then you already know how much you need to increment. You can then write a function to take that node tree and run it in a loop to do the increment. This way there would be no need for a global counter variable, or passing a counter in.

  • Configuration parameter which are stored in automationBuild.xml file

    Do you know the correct path for below configuration parameter which are stored in automationBuild.xml file which is kept in src folder of osm project?
    <property name="studio.weblogic.home" value=""/>
         <property name="studio.java.sdk.home" value=""/>
         <property name="studio.osm.sdk.home" value=""/>

    Hi Sachin,
    Here is the info,
    studio.weblogic.home=<Weblogic_Installated Dir>/wlserver_10.3
    studio.java.sdk.home= <JDK Installed Dir> +(C:\jdk1.6.0_11, Something like this)+
    studio.osm.sdk.home=<OSM Installed Dir>/SDK
    Thanks,
    Naveen Jabade

  • Getting the average of a set of numbers, confused by file IO, please help!

    What i need to do is get the average of a set of numbers, the problem is that i am reading these numbers in from files in different directories where each file returns a number, and the average for the directory is the numbers for each file in that directory added together and divided by the number of files in that directory.
    public static HashMap readDir(File path, HashMap map) throws IOException{
            File files[] = path.listFiles();
            float totalForDirectory = 0;
             int common = 0;
             int count = 0;
                    if(files != null && files.length > 0) {
                              for(int i=0; i<files.length; i++) {
                                    if(files.isDirectory()) {
    readDir(files[i], map);
    } else {
    //trying to count the number of files in the directory
    count++;
    totalForDirectory =(total(common, totalF1(), totalF2(files[i])));
    readFile(files[i]);
    //will contain pathname, and the average
    map.put(path.getCanonicalPath(), totalForDirectory);
    return map;
    In the above code, totalForDirectory contains the number for each file, i want to add together the result of this variable for each file, "file[i]" in the directory, and divide that by the number of files in that directory.
    Id appreciate any help
    Thanks

    What you want, It seems to me, is a recursive routine (for directories) which returns both a total and a filecount. Then these can be totalled at each level (togther with the count for each file).
    Probably the best approach is to pass a small object in which the totals are accumulated.
    Define a class something like:
    public class Accumulator {
       int count;
       int total;
       public double mean() {
          return total / count;
      public void add(Accumulator add) {
         count += add.count;
         total += add.total;
       public void add(int numberFromFile) {
          count++;
         total += numberFromFile();
      }Create an instance of this at the start of your scan directory method, and pass it when you call make the recursion. At the end of the scan the method would use the first add method to add it's local totals to the hight level total.
    Obviously you create an Accumulator for the first scan directory call which becomes the grand total.

  • Version-0.apversion could not be handled because Numbers cannot open files of this type

    Hi - I created a file in Numbers a couple of years ago and have been able to update it monthly since its creation.
    This morning I have tried to open the file and am getting the "Version-).apversion" could not be handled because Numbers cannot open files of this type.
    Any ideas for a fix?

    Hi Amelie,
    There are three major versions of Numbers:
    Numbers '08
    Number '09
    Numbers 3
    It is possible that an automatic update by App Store has installed the latest version of Numbers (Numbers 3) on your machine.
    Numbers 3 can not open a Numbers '08 document.
    Which version of Numbers is giving that error message? (In Numbers, Menu > Numbers > About Numbers.)
    Look in your Applications folder for sub-folders such as iWork '08 and iWork '09.
    Please call back with questions.
    Regards,
    Ian.

  • Had to reload window Vista need to reload stored cds from Windowsold file after reload

    had to reload window Vista need to reload stored cds from Windowsold file

      had to reload my computer after a HD failure. I reloaded everything along with current version of Itunes.
    Consider Windows 7 has its own built in data and system backup, and now Windows 7 (Dev) has a better hourly backup/archive versions, and there are 3rd party programs....
    you have the CDs still?
    Prosoft Data Rescue 3 for PC and Macs (demo) can scan a drive for recovery.
    Bad blocks, or issues with directory and such? out right hard drive failure?
    And then there are network storage if you have more than one computer, or use HomeGroup (Win 7) to access files across LAN.
    My Music Media Library is never on the boot drive, I wish the iPod backup wasnt as well.
    For an excellent utility to clone Windows OS drive2drive, I recommend and use Paragon HDM 2011 Suite, used as needed and weekly so I always have a system clone that I can pop in and boot from, no image, no restore needed (set the BIOS or hot key).  Wouldn't be w/o and $49. Takes 10 minutes for 50GB Windows OS.
    http://www.paragon-software.com/home/hdm-personal/

Maybe you are looking for