Sscanf in java.... sorry a stupid question

Hi all.
Which class/method i could use to do something as sscanf in java? (or strtok could be too)
I mean, i have a String
"110 20 somestring 2.3" and i want to do something like:
sscanf (buffer, "%d %d %s %f", &i, &j, aux, &f);
Thanks !

Use the StringTokenizer class from java.util to split the string at each space. You'll also have to do some conversions to get integers and floats from the String values (see Integer::parseInt() in java.lang).
http://java.sun.com/j2se/1.4/docs/api/java/util/StringTokenizer.html
http://java.sun.com/j2se/1.4/docs/api/java/lang/Integer.html

Similar Messages

  • Sorry for stupid question.  I have just got a download of a piano accompaniment (not from itunes).  I have ?downloaded it - where did it go?!  I cannot find it anywhere.  Thank you so much.

    Sorry for stupid question.  I have just got a download of a piano accompaniment (not from Itunes).  I have played it and think downoaded it but where did it go?!  I cannot find it anywhere!  Thank you!

    Generally it is not possible to download anything from a web site when using an iPhone, so if you were just using Safari, you probably didn't actually download the track but just played it from the web site. If you used some other app, tell us what app and someone may be able to provide further assistance.
    Regards.

  • Java/J2EE Config - Stupid Question # 2398375

    (On XP Home PC) - Just installed J2SE Version 1.4.2 into C:\j2sdk1.4.2_06, followed by J2EE Version: 1.3.1 FCS into C:\j2sdkee1.3.1 & I have an anoying configuration problem .
    I opened a DOS window & went into my projects folder. Command "java -version" works - gives version & full spiel. But "javac AdviceBean.Java" (which is in a sub-folder), gives a "'javac' is not recognised....." message.
    I have variable set as -
    CLASSPATH = $J2EE_HOME/lib/j2ee.jar;C:\Documents and Settings\Dave Cawdell\Projects
    Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Sonic\MyDVD;;C:\Program Files\ATI Technologies\ATI Control Panel;C:\j2sdk1.4.2_06;C:\j2sdkee1.3.1;
    JAVA_HOME=C:\j2sdk1.4.2_06\bin
    J2EE_HOME=C:\j2sdkee1.3.1
    I don't care what these SHOULD be set to, so long as everything works. I'm not an active Java developer, I'm refreshing on Java & teaching myself J2EE & especially EJB, so after 3 days messing with this & getting nowhere - does anyone have a clue, what stupid mistake I've made ?
    Here's hoping :-)

    Actually, it's not that big a problem at all.
    The CLASSPATH environment variable is an easy one - don't use it. If you're compiling and running in a command shell, set CLASSPATH using the -classpath option.
    If you're using a J2EE container like Tomcat or WebLogic, those use their own CLASSPATH and ignore any system CLASSPATH entirely. Learn what those containers assume for a CLASSPATH and you'll be better off.
    The PATH issue is an OS problem, not a Java problem. You need to tell the OS where to look for executables that you want to run without having to type in the complete path. No getting around that, unless you want to rewrite the OS.
    Most tools with an installer program will modify the PATH for you. You just have to be careful to note the changes they make, that's all.
    A word of advice: installing Java apps in a directory whose name contains spaces is usually a bad idea.
    %

  • I am English but live in Spain, When I got my new Macbook Pro I set the language to English, so far so good. Then I stupidly set the keyboard to British when it is obviously a Spanish keyboard. How can I reset it to Spanish. Sorry cant find question mark

    I am English but live in Spain, When I got my new Macbook Pro I set the language to English, so far so good. Then I stupidly set the keyboard to British when it is obviously a Spanish keyboard. How can I reset it to Spanish. Sorry cant find question mark

    LizMaddock,
    you can reset the input source to Spanish by selecting the Keyboard pane of System Preferences, selecting the Input Sources tab, and pressing the “+” button in the lower-left corner to select one of the Spanish input sources. The “Spanish – ISO” input source is most similar to the physical Spanish keyboard layout.

  • Probably a stupid question... so sorry in advance!

    I'm planning to buy Photoshop CS3. If I decide to fork out for a Power Mac later in the year, how easy is it to move my Photoshop application from my old G5 to the new PowerMac? Will the licence still be valid? The may be obvious but I've never change computers before so sorry.
    Same question for Aperture 2.

    Photoshop CS3 asks you to activate via internet, you can do this in up to two machines. Make sure to deactivate the software in your old machine before replacing it with the new one, or you'll have one of two activations lost.
    Aperture doesn't use this kind of protection so no worries here.

  • Sorry if this is a stupid question.

    How do I use a group I have created in my address book to send an email to everyone in that group. I'm sure it's very obvious, but I have been using the help feature in both mail and address book and it doesn't explain. I've also searched all over this site. I also don't want everyone on the email list to see each other's email addresses. Is this possible.
    Thanks for any advice.
    Lisa
    G-5   Mac OS X (10.3.8)  

    Lisa, no such thing as a stupid question, you have a question that you couldn't figure out, happens to anyone at some point.
    First, I'm assuming you indeed have a group formed in AddressBook (AB)
    - go to Mail and compose a new mail
    - click on the small button you see here in front of Account
    - and select Add Bcc field from the drop down menu
    - you should see the AB icon on top of the message window toolbar (if not, do a Customize Toolbar... and drag that AB icon there.
    - select the Icon, your AB data should now appear, including the group
    - select the group in the left column, and select all addresses in the right column (apple-A)
    - press To: button
    Now all your addresses will go to the To: field which you do not want. Copy all addresses in the To field (use apple-X to cut), then paste them in the Bcc field with Apple-V
    set your own email address in the To: field as this field should not remain empty
    insert message and send !

  • Sorry, stupid question

    I just got a 5g iPod. This is my first time using anything like this. My question is, can I charge this from any computer with a USB 2.0 port? If I use a relative's powerbook only to charge, will the iPod search their itunes and delete my songs and videos from my iPod by updating itself? it may be a stupid question but I need to know for sure. Thank you.

    To be on the safe side, if you are going to be docking iPod to any other computer other than it's "home system", iPod will need to be on manual sync.

  • A really stupid question from newbie...

    hello all,
    i am very new to java and i am trying to build a j2ee application...
    rite now....i need to let my app communicate w/ an outside program thru' XML..
    i had just learnt many thing about java w/ xml and i decided to use the XMLEncoder... it seems quite simple to use...BUT i have no idea on how to send/receive these XML files...i had thought of using socket connection, but i just found out that an EJB wouldn't allow socket networking... i bet this must be quite a stupid question coz i found nowhere teaching me this...=P
    if u know about this, pls point me to some relevant docs / sites....i am anxious to learn about it...
    thx so much,
    karloogunna~

    hello maesj, rune, and others,
    thx alot for your advice...
    and here's the environment i am working in:
    OS: w2k
    JDK: 1.4.1.01
    j2ee: 1.3.1
    jboss: 3.0.2
    i am using flash as my UI, so i need communication
    between the j2ee app and flash.
    the data transfer involves a number of arrays of
    objects (each object w/ a list of attributes...) so, i
    think using XML as data-exchange is quite suitable (am
    i wrong on this??)I don't know the first thing about Flash, but using XML as a means for exchanging data seams like a good idea, for the scenario you described.
    >
    and i am reading about the message-driven beans, i see
    that they got a function onMessage() from where i can
    get the XML strings (?), but i don't know how i can
    feed these strings into this JMS from flash...do i
    need to write a small java program on the client
    side?I haven't that much experience with Message Driven Beans. What I do know is that they employ the Java Messaging Service (JMS). If you write a small client appplication with JMS support... you might be close.
    >
    also, i am not sure if i can send out XML strings
    through the message-driven beans, i am reading on the
    JMS...it got the MessageProducer, MessageConsumer,
    MessageListener, and MessageSelector....should i be
    using this? or can i use this together with the
    message-driven beans??
    In a Messaging system you will need message producers, and message consumers. To enable two-way communication, you can setup both the EJB and the client to handle both. When a message arrives at the consumer (or subscriber if you like), the JMS Service invokes the onMessage method. So you should implement your logic in the onMessage method, for example inspect the XML content, and act upon its content.
    i am very sorry for my disorganized questions...(i
    used to do low-level programming =P)
    and really thank you for your advice!!!!
    No problem, the amount of information to read can be quite overwhelming. Using JMS is just a suggestion, and might be considered overkill for your application. If you're using an IDE, like Sun ONE, creating a message driven bean is easy, and can be tried out, without too much hours passing.
    Kind Regards,
    Rune Bj�rnstad.

  • Stupid question, I know, but after years of using Firefox, on this one I can't find the Page Reload icon?? Please help.

    In the past, when I want to refresh a page, I've simply gone to the page reload icon on the toolbar. On the new version, I can't fin the reload icon. Sorry I know this is a very stupid question,, but I just can't find that reload icon. The toolbar is a lot different from previous versions, but I'm sure tht pesky icon must be there somewhere!!

    Hi merren,
    Not a stupid question at all :) You should take a look at [https://support.mozilla.org/en-US/kb/common-questions-after-upgrading-firefox-36 this article with common questions after upgrading].
    You could also benefit from the looking at the article on [https://support.mozilla.org/en-US/kb/how-do-i-customize-toolbars customizing the tool bar]. That will show you not only how to verify that you have the refresh button, but give you options on where it lives as well.
    Hopefully this helps!

  • Ready for a stupid question?

    How do I get rid of a screensaver I downloaded? It's the "RainyDay2" screensave I got from Apple's download page. It makes my computer run slow, and I want to get rid of it, but I can't figure out where it is. I've done a search for it, I've looked in both screensaver folders (both empty, BTW), and I even tried running the installer again to see the target directory (the folder it said it was installing to was empty).
    Does anyone know how to delete it?
    (Sorry for the stupid question T-T)

    Take a look here:
    "/System/Library/Screen Savers"
    You no doubt had to enter your password to install it. I have come to really disapprove of programs that want your admin password in order to install. Indeed, I downloaded something the other day that wanted my password, and I declined. Then poked around in its package and discovered it did not need to do what it said, extracted the program, put it in Applications and it worked fine. Anyway, RainyDay should NOT have been set-up by its developer to be installed there, but I think it was.
    Francine
    Francine
    Schwieder

  • Stupid Question but need help

    Hey Guys
    This is going to sound like a stupid question, but ive been wrecking my head now for about 2 hours on it, and cant find any help on the net.
    Im looking to create an image to add to a j2me application. And basically it cant find the image.
    The image is in my c:\images folder and its called pike.jpg, when i use the following the code it does not find the image
    image = Image.createImage("C:/images/pike.jpg");
    image = Image.createImage("C/images/pike.jpg");
    image = Image.createImage("C:/\images/pike.jpg");
    image = Image.createImage("C:\\images/pike.jpg");Yet when i place it in my working directory and use
    image = Image.createImage("/pike.jpg");It works fine, basically how do i point to the directory c:\images\pike.jpg in java
    Thanks

    Mr.E.H. wrote:
    The MIDP one.
    http://java.sun.com/javame/reference/apis/jsr118/
    Thanks. Now that is clarified, I can see from the documentation:
    The name parameter is a resource name as defined by Class.getResourceAsStream(name) . The rules for resolving resource names are defined in the Application Resource Files section of the java.lang package documentation.
    So it's not a file name. The string you pass must be findable via the classpath.
    So, if C:\images is included in your classpath (which you'll need to do for this example), then just use "/pike.jpg" and have that file live in the images directory only.

  • Svn stupid question

    maybe a stupid question, but after 3 hours of digging i still can't figure out what does mean that package has a -svn extension....
    All because pacman is asking me if i want remove PACKAGE because it conflicts with PACKAGE-SVN...
    Thanks for being so patient...
    jacopo

    natalian wrote:svn/subversion is s version control system .. it basically tracks each update to a source tree so u can revert to a specific state for example .. pkg with -svn ,-cvs, -bzr, -etc .. is  usually the most bleeding edge version of that software, i.e, it's not released yet .. therefore pkg-svn is an unreleased version of pkg ... in most cases there should be no issue so if you just need extra functionality not provided by the offially released versioin or u just wanna try it out ... then replace the offending pkg on prompt .. i'd recommend sticking to the officially released one though, -svn can be buggy .. hope that made sense
    yes, thanks a lot....
    So, tryng to install (in my situation) xfburn or ristretto requires some xfce pgks that are still unreleased and conflicts (of course) with the current releases... right??
    well thanks a lot, i'm new to arch, but when talking about bleeding edge oriented distro, arch is really that...
    sorry for my poor english...
    thanks...
    jacopo

  • I'm new and have a stupid question...

    Hi,
    Im new to JAVA and have a probably stupid question wich my study books don't say anything about...
    When I use
    System.out.print("");
    to show some text on screen I just get a grey box without text.
    Im using Internet Explorer 5
    JAVA 2 IDE
    Forte 2.0
    Please help me out!
    When nothing shows on screen I don't know what I'm donig is right or wrong!

    If you are using swing (which is not supported in the browsers' default VM), you can enable your browser to use the plugin jre by converting your html page with the html converter. You can download this from http://java.sun.com/products/plugin/1.3/converter.html
    Also be aware that your browser might have cached older versions of your .class files. You might need to delete them first.
    I recommend using the appletviewer to test your applet first. Open a command line and run:
    appletviewer your_page.html

  • Hi! This might be a stupid question, but I just bought an IPod G5 60 GB. When you firstconnect your IPod you have to setup your ID. I'm using my brothers computer, who has an IPod too, so now I'm wondering when I set up my ID with his Itunes does his Ip

    Hi!
    This might be a stupid question, but I just bought an IPod G5 60 GB. When you firstconnect your IPod you have to setup your ID. I'm using my brothers computer, who has an IPod too, so now I'm wondering when I set up my ID with his Itunes does his Ipod still work with it??? Or would his ITunes just see my IPod? Or does his Ipod ID change to my ID?
    Or does it work without any problems, to setup two IDs on the same computer??
    Thanks!

    Hi!
    This might be a stupid question, but I just bought an IPod G5 60 GB. When you firstconnect your IPod you have to setup your ID. I'm using my brothers computer, who has an IPod too, so now I'm wondering when I set up my ID with his Itunes does his Ipod still work with it??? Or would his ITunes just see my IPod? Or does his Ipod ID change to my ID?
    Or does it work without any problems, to setup two IDs on the same computer??
    Thanks!

  • Really stupid question - Migrating from 6i to 11g

    Hi all,
    I'm a developer that have been working with oracle since Forms 3, right now I use Forms 6i and I would like to know what I need to use Forms 11g. I understand this new environment is web based, but to start developing and deploying, what I need? for example if I buy the Oracle Forms & Report 11g, I also will need the OAS? or just with Forms and Report I could deploy (somehow) the application?
    Please don't flame me, I just want to understand how this works now.
    Best Regards

    As my old college profession used to say - "The only stupid question is the one that doesn't get asked!" Forms 11g only supports web deployment. This means you will need the OAS with the Forms and Reports Services installed as well. Typically, the setup is three tiered ( 1 server = Database, 1 server = Application Server, 1 server = Infrastructure server ). You don't have to set up the technology stack multitiered - all three could reside on the same server or you could have the all three on the same machine but is not recommended. I would at least have the database on a server seperate from OAS.
    Here are a few links to get you started.
    Oracle Documentation
    * Check out: Development Tools - Oracle Forms, Middleware - Applications Server - Oracle Fusion Middleware 11g and Middleware - Data Warehousing and Business Intelligence - Oracle Reports
    Since you will be upgrading from Forms 6i to 11g, be sure to visit the Oracle Forms-Upgrading Forms 6i to Forms 11g documentation.
    BTW, welcome to the forums!
    Craig
    If a response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on May 6, 2010 2:09 PM

Maybe you are looking for