What method for reading 1.234.567 instead of 1234567 in JXL excel package

I want to read cells from an excel sheet. But I don't know getting the cell content as money quantity 1.234.567 instead of 1234567. What method(s) I shold use.

Try getting it as a String.

Similar Messages

  • How to create a method for reading a file

    i tried to make it as static method for reading a file and
    then to return string
    is this code correct?
              public static String fileMaterial(String fileName)
                   fileReader = new BufferedReader(new FileReader(fileName));
                   info = fileReader.readLine();
                   while(school != null)     {                    
                        return info;
                        info = fileReader.readLine();

    I created a class you might want to look at. I come from a world of C and love fgets() and other FILE stream functions. I created a class that uses the Java I/O buts to the calling application behaves like fgets and such. The block of code where I do the calling in the calling program even looks like C. In my class I capture almost all errors and set error buffers to the errors. The calling program looks at the return to see if it succedded or errored.
    BuffIO new = BuffIO.fopen("fiilename", "r");
    String s;
    if((s = new.fgets()) == null)
    System.err.println("error reading file: " + new.ferror());
    That would be waht the calling program does

  • Why no simple method for reading text files

    I'd like to know, after all this time why there is no simple method of reading ext files into a string.
    Yes, yes, I know all about buffered readers, (it took me long enough to figure them out) but they are cumbersome and seem to change every release (how many file methods have been deprecated...)
    Here's what I'm looking for:
    file.open();
    file.read(String);
    file.close();
    No single character at a time, no loop - the whole file into a single string in one shot. If buffers are used, i want it hidden.
    Perl, PHP, VB, C# all have this. Even Java has it when you write to a file.
    So why not on read?
    Yes, buffered streams are very elegant, but for what most programmers want to do, they are overkill and annoying.

    Just Dennis Ritchie's little joke.
    Do you have a better reason for wanting the feature
    other than that some other languages have it?Yes. It would save me time and help dozens of new programmers who continually ask this question in this and other forums. It is in other languages because people use it and want it - clearly Jarkata saw the need. If you don't like the idea, then I won't argue the point. We agree to disagree.
    Also did you have an answer for my question?in java.io.file you can do the following: (i've used it, it works) Granted, you still have to use the buffered output streams, which in my opinion should be abstracted for a simple text read and write.
    BufferedWriter outputStream = new BufferedWriter(new FileWriter(fileNewPath));
    outputStream.write(fileContent);
    outputStream.close();

  • Help with method for reading coeffecients.

    I am fairly new to Java programming and I was asked by my instructor to wright a program that calculates the quadratic formula via a loop. So far i have the following code:
       // Constructor obtains the number of equations as a parameter
       Quadratic2(int limit) throws IOException {  // Constructor
          // All computations are performed in a loop
          for (int count=0; count<limit; count++) { // setting count to 0, if count is less than limit , then count is incremented by 1
             // Reading the coefficients
             System.out.print("Please enter coefficient a: ");
             double coeffA = Double.parseDouble(inp.readLine());
             System.out.print("Please enter coefficient b: ");
             double coeffB = Double.parseDouble(inp.readLine());
             System.out.print("Please enter coefficient c: ");
             double coeffC = Double.parseDouble(inp.readLine());
             System.out.println();
             double Disc = discr(coeffA, coeffB, coeffC);  // Compute discriminant
             if (Disc >= 0.0) {  // Solution exists
                // Solving the equation
                double root1 = roots(coeffA, coeffB, coeffC, true);
                double root2 = roots(coeffA, coeffB, coeffC, false);
                // Outputting results
                System.out.println("Quadratic equation with the following coefficients:");
                System.out.println("A: " + coeffA + "; B: " + coeffB + "; C: " + coeffC);
                System.out.println("has the following solution:");
                System.out.println("Root1: " + root1 + "; Root2: " + root2);
             else {  // Solution does not exist
                System.out.println("Quadratic equation with the following coefficients:");
                System.out.println("A: " + coeffA + "; B: " + coeffB + "; C: " + coeffC);
                System.out.println("has no solution in the real domain.");
             System.out.println("");
       // A method to compute the discriminant
       double discr(double a, double b, double c) {
          return b*b - 4*a*c;
       // A method to calculate roots
       double roots(double a, double b, double c, boolean which) {
          double Disc = discr(a, b, c);
          if (which) {
             return (-b - Math.sqrt(Disc))/(2*a);
          else {
             return (-b + Math.sqrt(Disc))/(2*a);
       public static void main(String args[]) throws IOException { //Must throw an IO execption
          int noEqs = 1;  // Number of equations
          noEqs = Integer.parseInt(args[0]);  // Passed from command line
          Quadratic2 obj = new Quadratic2(noEqs);
    }I was told to read the coefficients with a method named readCoeffs() but evey time I try to do that I get several errors and as mentioned previously I am new to Java and therefore not able to interpret these errors. As you can see in the above code i read the coeffecients as they are entered but not via a method. I tryed using using the following but to no avail:
      double coeffA = readCoeffs(in);
          double coeffB = readCoeffs(in);
          double coeffC = readCoeffs(in);I was wondering if any of you more experienced programmers are able to show me how or help me write a method to read the coefficients? Any help or advice would be greatly appreciated!

    Sorry I should have been more specific in my question and provided more detail. Anyways i have revised my code to the following:
    //Java Program that Calculates the Quadratic Formula using a loop written by Kris Andrews
    // 10/08/07
    // Intro to Programming/COP 2006
    import java.io.*;//import java library
    class Quadratic2 { //Naming Class
       Quadratic2(int limit) throws IOException {  // Constructor that takes variable as parameter and computes as many times as the value entered
          // All computations are performed in a loop
          for (int i=0; i<limit; i++) { // setting i to 0, if i is less than limit , then i is incremented by 1
       // Declarations necessary to use kbd input //Declaring variable locally
       InputStreamReader inStream = new InputStreamReader(System.in);
       BufferedReader inp = new BufferedReader(inStream);
    // Method to read coefficients
       double readCoeffs() throws IOException {
             System.out.print("Please enter coefficient a: ");
             A = Double.parseDouble(inp.readLine());
             System.out.print("Please enter coefficient b: ");
             B = Double.parseDouble(inp.readLine());
             System.out.print("Please enter coefficient c: ");
             C = Double.parseDouble(inp.readLine());
             System.out.println("");
             return true;
       double Disc = discr(A, B, C);  // Compute discriminant
             if (Disc >= 0.0) {  // Solution exists
                // Solving the equation
                double root1 = roots(A, B, C, true);
                double root2 = roots(A, B, C, false);
                // Outputting results
                System.out.println("Quadratic equation with the following coefficients:");
                System.out.println("A: " + A + "; B: " + B + "; C: " + C);
                System.out.println("has the following solution:");
                System.out.println("Root1: " + root1 + "; Root2: " + root2);
             else {  // Solution does not exist
                System.out.println("Quadratic equation with the following coefficients:");
                System.out.println("A: " + A + "; B: " + B + "; C: " + C);
                System.out.println("has no solution in the real domain.");
             System.out.println("");
       // A method to compute the discriminant
       double discr(double a, double b, double c) {
          return b*b - 4*a*c;
       // A method to calculate roots
       double roots(double a, double b, double c, boolean which) {
          double Disc = discr(a, b, c);
          if (which) {
             return (-b - Math.sqrt(Disc))/(2*a);
          else {
             return (-b + Math.sqrt(Disc))/(2*a);
       public static void main(String args[]) throws IOException { //Must throw an IO execption
          int Equations = 1;  // Number of equations
          Equations = Integer.parseInt(args[0]);  // Passed from command line
          Quadratic2 obj = new Quadratic2(Equations);
    }But I get the following error:
    Quadratic2.java:23: ';' expected
    double readCoeffs() throws IOException {
    ^
    Quadratic2.java:23: not a statement
    double readCoeffs() throws IOException {
    ^
    Quadratic2.java:23: ';' expected
    double readCoeffs() throws IOException {
    ^
    I did not receive this error prior to trying to read the coefficients via a method and what do i need to to correct these errors? Again any help would be appreciated!

  • Instrument i/o assistant always generates async methods for read and write!

    I am trying to generate VI by instrument i/o assistant, but it generated 'Visa write' and 'Visa read' always in asynchronous mode. Even if I unchecked asynch boxes in MAX->Visa Test Panel.
    I need only synchronous mode! And it is very uncovenient after open front panel change  Synchronous I/O Mode from Asynchronous to Synchronous!

    postoroniy_v wrote:
    Asynchronous mode does not work for my hardware.
    and before Instrument i/o assistant  generate diagram I have possibility to check requests and responses to/from my hardware. in this case everything is fine.
    after generate  does not work.
    Is it possible you don't have a sufficient amount of wait time between a VISA Write and VISA read to give the instrument time to receive the communication and turn around a response?  Take a look at Basic Serial Read and Write example VI.  If you are using the I/O assistant and checking things manually, it will work because there is no way you can generate a Read too fast.  It still would take a fraction of second to generate the write and do whatever clicking to generate the read.

  • Native method for reading of linux fifo

    Anyone khow how to use c function (read/wite fifo) with java

    This example shows that a fifo (named pipe) can be used in a FileOutputStream and a FileInputStream:
    import java.io.*;
    public class a {
            public static void main(String args[]) {
                    try     {
                            main0(args);
                    catch (Exception e) {
                            e.printStackTrace();
            public static void main0(String args[]) throws Exception {
                    boolean input=args.length==2;
                    if (input) {
                            InputStream is=new FileInputStream(args[0]);
                            int c;
                            while((c=is.read()) != -1) System.out.print((char)c);
                            is.close();
                            return;
                    OutputStream os=new FileOutputStream(args[0]);
                    for(int i='a';i<='z';i++) os.write(i);
                    os.close();
    }posman@linux:~/ivan> javac a.java
    posman@linux:~/ivan> mkfifo fifo
    posman@linux:~/ivan> file fifo
    fifo: fifo (named pipe)
    posman@linux:~/ivan> java a fifo a &
    [1] 9696
    posman@linux:~/ivan> java a fifo &
    [2] 9704
    posman@linux:~/ivan> abcdefghijklmnopqrstuvwxyz
    [1]- Done java a fifo a
    [2]+ Done java a fifo

  • Quickest method for reading and writing files

    Hi
    I need help regarding file operations.(Reading and Writing). Currently I am using BufferedReader and BufferedWriter to read and write files. But the files (XML) are very huge files(from 30 -50 mb). This is slowing the application to a great extent. Is there any other approach to perform the above mentioned operations on XML files in a fast manner.
    Thank You
    Mansoor.

    Hi
    Can u let me know how to use the java.nio pavkage for primitve data types(int,float..., boolean). I have tried it but found no success.
    Thank You
    Mansoor

  • What is the direct connect method for transfering photos from my macbook pro to my iphone without using iTunes syncronization? (iow: a simple photo copy from mac to iphone?)

    I feel like I should know the answer to this. I can't believe it is a hard question.
    What is the direct connect method for transfering photos from my macbook pro to my iphone without using iTunes syncronization? (iow: a simple photo copy from mac to iphone?)
    Easy? Right?
    Just plug my iphone in to a mac and copy a photo from the mac to my iphone.
    I don't have internet access - I can't email it, or mobileme it, or dropbox it.

    iTunes. Other than that there is no direct method. However, do try the iPhone forums.

  • I already have a valid payment method for my iTunes account, but can't get past the Family Sharing setup prompt telling me to add a payment method . What to do?

    I already have a valid payment method for my iTunes account, but can't get past the Family Sharing setup prompt telling me to add a payment method . What to do?

    I had the same problem and found a bunch of others did, too.  Unfortunately all the posts had no responses!  Anyway, I previously had my payment method linked to my paypal.  I tried changing it to my credit card and it worked.  Don't know if there's a bug with using paypal but that seemed to be the culprit for me.  Good luck!

  • What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?

    Hi All,
    I am new to TestStand. Still in the process of learning it.
    What are Parameters? How are they differenet from Variables? Why can't we use variables for passing data from one sequnece to another? What is the advantage of using Parameters instead of Variables?
    Thanks in advance,
    LaVIEWan
    Solved!
    Go to Solution.

    Hi,
    Using the Parameters is the correct method to pass data into and out of a sub sequence. You assign your data to be passed into or out of a Sequence when you are in the Edit Sequence Call dialog and in the Sequence Parameter list.
    Regards
    Ray Farmer

  • When bouncing- what's best method for smallest file size/highest quality?

    I am in the process of embedding 3 mp3's into a PDF to submit as a portfolio. The PDF also has text, and two scores included, and with the 3 embedded mp3's it can't be more than 10mb.
    So my question is: When bouncing a project out of Logic, what is the best method for getting the smallest file size, but retaining the best audio quality? And once it's out of Logic and it is an mp3 or other type of audio file, is there a best format for compressing it further, and still maintaining the relative quality?
    I bounced out the three projects into wav's. Now I am using Switch for Mac to compress them down to smaller Mp3's. I basically need them to be about 3 mb each. Two of the recordings sound OK at that size, but they are just MIDI(one project is piano and string quartet, the other is just piano- all software instruments. The recording that combines MIDI and Audio and has more tracks (three audio tracks and 10 Midi/software instrument tracks)and sounds completely horrible if I get it under 5 mb as an mp3. The problem is that I need all three to equal around 9mb, but still sound good enough to submit as a portfolio for consideration into a Master's program.
    If anyone can help I would really appreciate it. Please be detailed in your response, because I am new to logic and I really need the step by step.
    Thank you...

    MUYconfundido wrote:
    I am in the process of embedding 3 mp3's into a PDF to submit as a portfolio. The PDF also has text, and two scores included, and with the 3 embedded mp3's it can't be more than 10mb.
    So my question is: When bouncing a project out of Logic, what is the best method for getting the smallest file size, but retaining the best audio quality?
    The highest bitrate that falls within your limits. You'll have to calculate how big your MP3's can be, then choose the bitrate that keeps the size within your limit. The formula is simple: bitrate is the number of kilobits per second, so a 46 second stereo file at 96 kbps would be 96 x 46 = 4416 kbits / 8* = 552 kBytes or 0.552 MB. (*8 bits = 1 Byte)
    So if you know the length of your tracks you can calculate what bitrate you need to keep it within 10 MB total.
    I consider 128 kbps the lowest bearable bitrate for popsongs and other modern drumkit based music. Deterioration of sound quality is often directly related to the quality of the initial mix and the type of instruments used in it. Piano(-like) tones tend to sound watery pretty quickly at lower bitrates, as do crash and ride cymbals. But don't take my word for it, try it out.
    And once it's out of Logic and it is an mp3 or other type of audio file, is there a best format for compressing it further, and still maintaining the relative quality?
    You can only ZIP the whole thing after that, but that is just for transport. You'll have to unzip it again to use it. And no, you cannot compress an MP3 any further and still play it.
    I bounced out the three projects into wav's. Now I am using Switch for Mac to compress them down to smaller Mp3's.
    That is silly, you could have done that in Logic, which has one of the best MP3 encoders built in. And how good encoders are will especially come out at bitrates around or below 128, which you might be looking at.
    I basically need them to be about 3 mb each.
    So, one more scrap of info we need here: how long are those three pieces, exactly? I'll calculate the bitrate for you - but please bounce 'm directly out of Logic as MP3's. They will very probably sound better than your WAV-conversions made with Switch.
    !http://farm5.static.flickr.com/4084/4996323899_071398b89a.jpg!
    Two of the recordings sound OK at that size, but they are just MIDI(one project is piano and string quartet, the other is just piano- all software instruments. The recording that combines MIDI and Audio and has more tracks (three audio tracks and 10 Midi/software instrument tracks)and sounds completely horrible if I get it under 5 mb as an mp3. The problem is that I need all three to equal around 9mb, but still sound good enough to submit as a portfolio for consideration into a Master's program.
    Length of the piece? And does the .Wav bounce you have sound OK?

  • What method should be used for resizing the particular JTable Column width

    I have a four table. Only one table which are on top have a table header. I want that when user resize the topmost table with a mouse other table colume also be resized automatically. So I want to know that what method should be used for resizing the particular JTable Column width.
    Thanks
    Lalit

    maybe you can implement a interface ComponentListener as well as ComponentAdapter with your topmost Table.
    for example:
    toptable.addComponentListener(
    new ComponentAdapter(){
    public void componentResized(ComponentEvent e){
    table1.setSize(....);
    table2.setSize(....);
    /*Optionally, you must also call function revalidate
    anywhere;*/
    );

  • What is the JSp equivalent method for PHP isset function

    Hai guys,
    can u tell me the JSP equivalent method for PHP isset function.

    isset checks what? parameters?
    if(request.getParameter("paramname") != null) {                                                                                                                                                                               

  • What is a Dynamic Proxy Class or Method for?

    I only recently "discovered" proxy classes/methods.
    Im rather curious about them because I still cant manage
    to understand what they do or what theyre for.
    Can anyone give a simple and practical use for this language feature?
    I read this:
    http://java.sun.com/developer/technicalArticles/JavaLP/Interposing/
    Which seems to indicate that proxy classes are for intercepting
    method calls?
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/Proxy.html

    becareful what you ask for? :)
    http://java.sun.com/j2se/1.3/docs/guide/reflection/proxy.html
    http://www.javaworld.com/gomail.cgi?id=658521
    http://www.codeproject.com/dotnet/dynamicproxy.asp
    http://www.javaworld.com/javaworld/jw-02-2002/jw-0222-designpatterns_p.html
    http://www.devx.com/Java/Article/21463/1954?pf=true
    http://www.developertutorials.com/tutorials/java/java-dynamic-proxies-050514/page1.html
    http://today.java.net/pub/a/today/2005/11/01/implement-proxy-based-aop.html
    http://joe.truemesh.com/blog/000181.html
    http://www.ociweb.com/jnb/jnbNov2005.html
    http://builder.com.com/5100-6370-5054393.html
    http://www.javaworld.com/javaworld/jw-02-2002/jw-0215-dbcproxy.html
    http://today.java.net/pub/a/today/2006/07/13/lazy-loading-is-easy.html
    http://www.artima.com/weblogs/viewpost.jsp?thread=43091

  • What is the most secure password transfer method for POP3 supported by Thunderbird?

    I will receive eMail from a POP3-Server that support encrypted transfer of passwords with the SASL-Methods "SCRAM-SHA-1" and "SCRAM-SHA-256" (successful tested with the command line tool 'mpop') but Thunderbird say that the Server does not support encrypted transfer of Passwords. I think in real Thunderbird does not support the strong Methods offered by the POP3-Server.
    What is the most secure method for Password transfer on POP3 that is supported by Thunderbird?
    Greetings Erik

    I do not see SASL listed, do you?

Maybe you are looking for

  • Call specfic file in CHM file

    Hi All, I have created .chm file. Now I want to open specific htm file on press of F1 on the form. How do I give the path ? I am using following code to call chm file: If pVal.MenuUID = "275" And pVal.BeforeAction = True Then                 If SBO_A

  • Problem passing texts into sap-script

    Dear Experts, I have a requirement, where I have to pass some text-lines from my selection-screen of the driver-program to the sap-script,i.e. whatever I write in those text fields that should be displayed(printed) on the specified place of my script

  • HT1752 can i get ISO X 10.5 for my old mac ?

    Hi, I have an old i mac and would like to update to os x 10.5 or my i-pod wont update, nor will it recognise my i-pod. I used to have an old desktop from Dell that my i-pod was originally registered too and I know I can authorise another computer to

  • Executing procedures on others schemas

    Hello there, I have 2 schemas A and B, that have the same objects, but different data. Being connected as user A, I have to launch a stored procedure F on the B schema; F updates a table X. Is there a way to tell Oracle to execute the stored F on B.X

  • IMessage not allowing set up, iMessage not allowing set up

    I had this problem before with iPad 2 and tech support high up from iTunes needed to fix something. Just restored iPad 2 and same problem Last time was related to credit card registration date change. It's a real pain to get a message like the user n