Can't figure out how to read from .txt file...

It looks so simple:
I have a txt file with one line in it:
1038It is actually a highscore for a little game. But how do get this out of the file into an int?
Thank you.

this reads out a complete text file:
try
FileInputStream fis = new FileInputStream(fileName);
BufferedInputStream bis = new BufferedInputStream(fis);
DataInputStream dis = new DataInputStream(bis);
String tmp = "";
while ( dis.available() > 0 ) { tmp += dis.readLine() + "\n"; }
dis.close();
bis.close();
fis.close();
} catch (Exception e) { e.printStackTrace(); }
if you want to convert string to int use
int i = Integer.parseInt( String );

Similar Messages

  • HT201250 How do I restore photos from Time Machine?  All of my photos have been imported within iPhoto and therefore are exported to Time Machine via an iPhoto file.  I can't figure out how to break individual photo files out of the iPhoto file.  Any idea

    How do I restore photos from Time Machine?  All of my photos have been imported within iPhoto and therefore are exported to Time Machine via an iPhoto file.  I can't figure out how to break individual photo files out of the iPhoto file.  Any ideas?

    You might post this query on the iPhoto forum and perhaps someone there can provide an answer.
    I tried this on my MBP and it seems that you have to restore the entire iPhoto Library.  What I did was put the current library in a separate folder on the desktop and then I restored the library from a prior date.  If you were to do that, you then could extract the desired photos and then delete the restored library.  Then place the current library back to the original location and import the desired photos.
    Not tidy but it seems it will work.
    Ciao.

  • Instapaper- can't figure out how to read page offline

    Can anyone help me with how to read a web article offline with Instapaper Free? I used the Instapaper "read later" bookmarklet, which appeared to save the story, but I can't figure out how to access the text version offline.

    Hi, thanks for taking time to reply, and I'm sorry for confusion of the two types of script. The only reason I am using shell script to test IP is I haven't figured out how to test it with Applescript. I will use only Applescript once I get it all figured out, as I undeerstand shell script even less than I understand Applescript.
    The begining script writes user name and email address to a plist from user input, then runs the above script to test and send mail. I just can't figure out how to have mail "make new message" with the "username" and "emailaddress" values already contained in the plist. I have seen that I can't use "property list file" unless it is directly under "tell application system events", but I am stuck on how to do this, and have mail use the values. Thanks again
    tell application "Mail"
    set theName to value of property list file item "username" of p_list --this is what I've been trying to figure out.
    set theAddress to value of property list item "emailAddress" of p_list --p_list path is at the begining of script.
                                 set newMessage to make new outgoing message with properties{visible:true, subject:"Your IP Address has changed",content:"Your Current IPAddress is: " & Current_ipAddress}
                              tell newMessage
      make new to recipient at end of to recipients with properties {name:theName,address:theAddress} --This is where I'm trying to use them
                              end tell

  • With the new update, I can't figure out how to merge duplicate "Faces" files together, so I end up with one location per face.

    With the newest update, I can't figure out how to merge duplicate files in "Faces" (iPhoto).  I have more than one file going for a face, and use to be able to click and drag them into merging.  Can't seem to do it now.  Can anyone please help?  Thanks

    Are you talking about iPhoto or Photos? If Photos, do you mean that Photos has several files for the same person but they are labeled differently and you are trying to merge them as one? If so, then you have to rename one of the files to match the other one with the correct name.  If this is not what you mean then could you explain more clearly what you mean. To give an example if I click on Faces and Photos shows me all named faces in the top and on the bottom there are suggested faces that can be dragged onto a face in the top level to merge.  If you try to merge two face groups in the top level that are the same person but for some reason the faces are labeled differently you have to label them with the name you want to use and then they will automatically merge.

  • I just bought Export pdf, and can't figure out how to convert a pdf file to Word

    I just bought Export PDF.  I have a pdf file I want to convert to Word and can't figure out to do it.

    Ask in the http://forums.adobe.com/community/exportpdf forum.

  • How to read from txt file that has words in between?

    Hi all,
    I am using Labview 8.2.
    I would like to read from a text file.  I have data (after each time it is has averaged over 100 waveforms) repeatedly stored on to the file.  The idea is to further improve SNR in post processing by again averaging the data (that has been averaged over the 100 waveforms).  
    I can get LabView  to save the data repeatedly into the file, so it keeps getting appended.
    The problem is to read the data in labview so I can now again average it.  The problem is the labview seperates the sets of data with the following:
    " Channels    1    
    Samples    9925    
    Date    2008/10/28    
    Time    17:16:11.638363    
    X_Dimension    Time    
    X0    -3.0125000000000013E-3    
    Delta_X    2.500000E-6    
    ***End_of_Header***        "
    So When I read it, it only sees the first set of data.
    Can someone please tell me how to read all the sets of data in labview?
    I have attached the file I want to read "acquiredwaveform.txt"  and the basic VI (really basic btw) to read the file.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    ReadFileAndAverage.vi ‏48 KB
    acquiredWaveform.txt ‏605 KB

    Thanks again DFGray for the comments. 
    After the correlations to find the peak positions, i just take the max value.  And you are right the accuracy is limited by the number of  samples per cycle.  Perhaps it would be clearer if you see the code.
    1) Basically I get a signal on the up and downslope of the sine wave.  On the down slope however the signal is negative, i.e. its is flipped.  So before I shift and average...I 'cut' the waveform into 4 (when cycles per buffer = 2, then I get 4 signals, 2 on the up slope and 2 on down slope) bits.  Counting from one, I flip the even number, cut it, and but an array of waveforms which is then sent to be convolved and shifted.
    2) Array of waveforms are stored to be phased shifted (Convolve and shift vi) and averaged (entire averaging vi which uses the convolve and shift vi as a sub vi). 
    * Phase shifting doesn't work when I cut and put it together (So something is wrong in cut waveform vi) 
    * Also if it isn't too time consuming could you give me an example of interpolating and shifting thing.
    * Also if you have any comments regarding the following VIs please let me know.  
    Thanks 
    Attached is:
    1) Cut waveform vi
    2) Convolve and shift
    3) Entire averaging 
    Attachments:
    SubVICutWaveforms.vi ‏37 KB
    SubVIConvolveShift.vi ‏30 KB
    SubVIEntireAveraging2.vi ‏43 KB

  • I can't figure out how to upgrade from Photoshop CS4 to CS6.

    Apparently CS4 refuses to read Canon 6D RAW files so I need to upgrade.
    I am using a Mac running OSX 10.9.1 Mavericks.
    How do I go about upgrading from CS4 to CS6?? I can't seem to find a link that allows me to do this.
    Thanks!
    Sebastian

    you can upgrade from cs5 to cs6, but not from cs4 to cs6. 
    you can join cc to access ps cs6 and ps cc:  http://www.adobe.com/products/photoshop/buying-guide.html
    in particular, note the 9.99/mo Creative Cloud — Photoshop Photography Program

  • I bought a subscription to a magazine and I can't figure out how to read one without buying a separate magazine...if that makes sense? Help!

    I bought a subscription for a month to try out us weekly here on the iPad and I'm confused as to how to use a paid subscription on here.

    I'm sorry, I mean Feast of Crows-Book 4.

  • I downloaded the newest update on my Ipod Nano (generation 6?) Now I can't swipe and go back. I can't figure out how to go from music to podcasts, etc.

    Once I downloaded the new update, I cannot move between musice, fitness, podcasts, etc. The only way it seems to reset is to plug it into the computer. Right swipe does not take me back anymore.

    i have the same problem, if u find it out please let me know :C i can erase or put new songs from my pc to itunes u.u

  • I can't figure out how to export the information files I have created with the photos in iphoto. any help?

    Is there a way to export files created for photos? I seem to have no problem exporting photos but the information I have about them cannot be found in teh exported version.

    There is no way to do that. Later versions of iPhoto can export with all the metadata written to the IPTC and Exif metadata.
    Regards
    TD

  • How do you move your music library from a laptop to a desktop? I have moved my library from a laptop to another laptop but can't figure out how to move music from laptop to desktop. Anybody know? Thanks

    How do you transfer your music library from itunes on a laptop to a desktop? I have transfered from one laptop to another and from desktop to laptop but can't figure out how to go from LAPTOP TO DESKTOP> Thanks

    Hello, Sandralee59. 
    Thank you for the question.  The attached article below provides multiple options for moving your iTunes library to a new computer. 
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/ht4527
    Cheers,
    Jason H. 

  • Can't figure out how to PUT

    First off, I'm a Newbie to Dreamweaver. So. I'm in a real
    learning phase.
    I can't figure out how to "Put" my development file to my web
    Server. I have an ftp connection. At least I think I do since I
    have file list that seems to be pointing to the files I have on
    webserver. I manually copied my files from my development folder to
    my web server. Now I want to use Dreamweaver to put my files and
    then I want to have Dreamweaver manage my file so that next time I
    one have to upload my "Changed" files. I searched Dreamweaver Help
    and didn't understand what I read. Sorry..
    Appreciate any help you can give me, or point me to somewhere
    on the web that my a step by step procedure.
    Thanks....

    Please tell me this - when you look at the name of the site
    in the drop-down
    list of defined sites on the left top of the Files panel, do
    you see a
    folder icon, or a little computer icon?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "bruceaj" <[email protected]> wrote in
    message
    news:epr3mt$4mu$[email protected]..
    > First off, I'm a Newbie to Dreamweaver. So. I'm in a
    real learning phase.
    >
    > I can't figure out how to "Put" my development file to
    my web Server. I
    > have
    > an ftp connection. At least I think I do since I have
    file list that seems
    > to
    > be pointing to the files I have on webserver. I manually
    copied my files
    > from
    > my development folder to my web server. Now I want to
    use Dreamweaver to
    > put my
    > files and then I want to have Dreamweaver manage my file
    so that next
    > time I
    > one have to upload my "Changed" files. I searched
    Dreamweaver Help and
    > didn't
    > understand what I read. Sorry..
    >
    > Appreciate any help you can give me, or point me to
    somewhere on the web
    > that
    > my a step by step procedure.
    >
    > Thanks....
    >

  • I gifted a ringtone to my sister that I purchased from the iTunes store, and it is on her phone, but we can't figure out how to get it moved to her ringtones.  Can anyone help?

    I gifted a ringtone to my sister that I purchased from the iTunes store, and it is on her phone, but we can't figure out how to get it moved to her ringtones.  Can anyone help?

    Edit > Preferences.  Select the check box for Ringtones, this will add them to the listing in iTunes. 
    Not sure that really answers your question though.

  • Can't figure out how to stop my MBP from opening programs at startup, namely word and messages

    Recenty my MBPro has started opening MS Word and Messages at startup and I can't figure out how to stop it?  I've tried selecting and de-selcting the startup option from the dock but this doesn't help.  Does anyone have any suggestions?

    System Preferences has a setting for this.
    In the Users & Groups section you will fine a "Login Items" header.  This is a list of all the programs that will open automatically when you log in.  You can select any program and click the [--] button below that window to stop the program from opening automatically.

  • I have a Verizon IPhone 4 and i can't figure out how to get my ringtones from an app to my iTunes account, it doesn't have a tab for Ringtones! I have tried unplugging it and checking if would show up but it didn't, how do you enable the ringtone folder?

    I have a verizon IPhone and i can't figure out how to get my ringtones from the app to iTunes, my account doesn't have a ringtone section in the liRingtone Folder?brary, how do you enable the ringtone folder?

    Edit > Preferences.  Select the check box for Ringtones, this will add them to the listing in iTunes. 
    Not sure that really answers your question though.

Maybe you are looking for

  • Sale Order Status Report

    Dear Expert. I want Sales Order Status report as below mentioned format required quarry base report from Date to To Date. Location-OrderSeries-OrderNo-CardCode-CardName-ItemCode-Item Descripotion-Inv.UOM-Order Qty-Allocated Qty-DeliverQty-Peniding Qt

  • Avi file does not have the same resolution as image file?

    I'm using LabView with an IEEE-1394 camera and I set up the camera to record at a resolution of 1280 x 960 and can snap images and save them at that resolution from Measurement and Automation Explorer, but when I record avis using LabView, they have

  • Dest Delimiter parameter in bic module

    Hi Experts, I am working on a IDoc to EDI scenario using seeburger modules (bic). While creating a EDI file on Target FTP server ,EDI content is written into file as a single line instead of a new line after every record. Please let me know if i had

  • BR ARCHIVE TAKES LONG TIME

    Hi Gurus, We are taking the BR Archive through the DB13 , The Process goes until : WARNING: sort_backup_type not specified in .utl file WARNING: default sort_backup_type to <size> for backup Program:                /usr/sap/PSU/SYS/exe/run/backint 6.

  • How to install gst ffmpeg in arch

    how do in install gst ffmpeg?i have already downloaded the package.i want to be able to play all formats with totem.