Creating and EOF loop

hi,
newbie
I am trying to read in from a text file line by line, I want to do this with a while loop to tie in with the rest of my project.
I wonder if anyone would be able to tell me how to create this loop, i have tried using the code below but have no clue about creating one of these
while (file != EOF)
file is a variable containing the path of the desired file and i thought that EOF meant End Of File, this is the only part i need and you help would be much appreciated
Dave

You need to find out about I/O and streams etc. which I find quite awkward. If you just want to read a text file a line at a time:
import java.io.*;
String s = "";
try {
BufferedReader br = new BufferedReader(
                     new FileReader("yourFile.txt"));
   while (s!=null)
       s = br.readLine();
       System.out.println(s);
    }//end while
catch (Exception e)
   System.out.println("error");
}I think that will work

Similar Messages

  • Creating and Saving My Own Midi Loops/Instrument

    I know how to create a new instrument in GB but can I also create and save midi loops that are attached to the instrument and save them in the loop browser? The same way other midi parts work so when you drag the midi out of the loop browser and into your session it loads both the part and the instrument at the same time?

    spidernook wrote:
    can I also create and save midi loops that are attached to the instrument
    select your loop and use the Add To Loop Library menuItem

  • When I export a AAF file from Protools 9 and Import the file into Logic ProX the drum track is out of sync.  I created the drum loop using NI Maschine.  Has anyone else seem this??

    When I export an AAF file/project from Protools 9 using an external drive and import the AAF into Logice Pro X the drum track does not play correctly.  It is out of sync with the rest of the track.  I created the drum loop as a plugin using Native Instruments Maschine. Has anyone else had this problem??  Also how would I go about exporting the midi tracks from the Protools session.  The midi track does not show when the file is imported to Logic Pro X.  The midi data should export with the AAF file correct??

    Are you using any plugins in Logic?
    In Preferences/Audio  under the General tab, how do you have the plug-in-latency compensation set?

  • With iDVD, how can I create a DVD that auto plays on insert and then loops?

    I want to burn a presentation using idvd which will be played at an exhibition. how do I create a dvd without menu that auto plays upon insert and then loops?
    Thanks
    Message was edited by: Host <to clarify Subject>

    To create a OneStep DVD:
    Connect your DV camcorder to your computer and set the camera to VTR, VCR, or Play mode. Turn on your camcorder if it doesn't turn on automatically.
    Open iDVD and click the OneStep DVD button. (If iDVD opens to a recent project, choose File > OneStep DVD.)
    Insert a recordable DVD disc.
    iDVD rewinds the tape in the video camera and captures the video.
    ------------or-------------
    To burn a OneStep DVD from a folder:
    Choose File > "OneStep DVD from Movie."
    Locate the movie you want to add in the dialog that opens, then click Import.
    Insert a blank DVD disc into the optical drive.
    This kind of disc is sometimes called "kiosk mode" and is a good way to create demos or other presentations that play automatically and require no user interaction.

  • Can we create our own loops? Basic question.

    Hi,
    Can we create our own loops in Logic Pro. I see in all the tutorials. They are either taking input from external instruments OR use existing apple loops.
    I have tried FL studio demo to create our own loops. But there is no trial version for Logic Pro. Need your inputs before I purchase it.
    Thank you.
    Anji

    Yes you can!
    It is as simple as selecting a Region (optional trimming recommended) and choose the Export command.
    A Dialog window opens up that lets you enter the metadata
    Apple had its separate "Apple Loop Utility" app (now only available in the developer package) that allowed you to create loops in a standalone app. The built-in loop capability in Logic uses part of that engine.
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals/
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • Is there a way to create an endless loop of one playlist?

    I have a playlist where I would like to create an endless loop. Is there a way to accomplish this task? Software Version 1.2.
    Someplace I read about going into Settings and down to "repeat" and selecting "all." The settings on my iPod Nano does not show "repeat" in the Settings.

    Start your playlist and tap on the screen while the song is playing. Tap on the repeat symbol showing on the screen then select the repeat list symbol on the left hand side.
    http://manuals.info.apple.com/en_US/iPod_nano_6thgen_User_Guide.pdf
    Message was edited by: deggie

  • What are the "Add to Loop Library" requirements for creating automatically conforming loops?

    I am trying to create my own loops that conform to the tempo and key of a song. I have made several loops in this way by selecting a region that is exactly 4 bars, for example, and then selecting "Add to Loop Library". If the sample is cut correctly, the "Type:" field is enabled which allows you to make it a Loop and therefore have it automatically conform to the song tempo.
    In the past I have made loops that were very long, up to 128 beats, for the purpose of making mashups using instrumental tracks that I want to conform to the song. I now can't seem to create a large loop but I am not sure why. I know it is possible, but I don't know the steps I took to get there.
    What are the exact requirements that allow a loop to be added to the loop library while also conforming to song key and tempo?

    In the past I have made loops that were very long, up to 128 beats
    The longest loop I managed to save as "Loop" had 55 measures (220 beats, 203 bpm). Longer loops could only be saved as "One shot". And the loop had to be cut at the end, not simply be trimmed by dragging the end of the region. The tempo matters; for a slow song the loop can only have fewer measures.

  • Create and save a .pdf file

    Afternoon!  I am creating a pdf utilizing the cfdocument tag and it works great.  It opens and displays well.  My question is, is there a way to automatically save that generated pdf on the server without opening it?  My end goal is to run a scheduled task every week that creates and saves a pdf automatically.

    <cfdocument format="pdf" orientation="landscape" filename="YourPDFName.pdf" overwrite="yes">
    it will save a copy of the pdf in the same folder as the <cfdocument> is run from, the problem I got is it wond display the pdf at creation time, all that is returned to my screen is the letter "z"
    so may be best to fun the code in a loop and one time add in the filename and overwrite paramaters, if you dont need it displayed, then your gold.
    Craig Wiseman

  • How to go on creating activities in loop?

    Hi!
    Lead record type has activities associated with it.
    if a new lead is created, automatically an initial activity should be created with certain details and assigned to a particular sales rep. this i can do with workflow. this is fine.
    Now i want that, when ever the sales rep completes the activity and marks status of activity as _"Completed"_, automatically a new activity record should be created and details of newly created activity should be filled by the sales rep who marked the old activity status as "Completed". This cycle should go on.
    Also there has to be a stopper to this loop to which only a manager can have access.
    i tried with workflow. For that i created a custom picklist on activity record type with values as "Continue" and "Stop". I set the default value as "Continue". Only manger has access to this picklist. My logic was unless the manager sets the value of the picklist as "Stop", the activity should be created in loop. I did in this way:
    Workflow Name: Activity Loop
    record Type: Activity
    Trigger Event: When modified record saved
    Workflow rule condition: LookupValue("OCC_INDEX_CUST_LOV_EVT_ACT_0", "Continue") AND LookupValue("EVENT_STATUS", "Completed")
    But when i saw the available Workflow actions, there was no mention of creating a new activity in it. so now how should i create new activity when old activity is completed? i am struck up here. How can continue from this point?
    I don't mind going for any other way if it satisfies my requirement.
    thankx and regards
    Edited by: user10434678 on Feb 20, 2009 7:23 PM

    Hi !
    I'm afraid this won't be possible with workflows... Oracle made it not possible to create an activity via a workflow on the activity entity.
    Imagine that someone create something like "when a new activity is created, then create an activity", you'll agree that this will shut down the server !! I think that's why they don't allow this action on this kind of workflow.
    I'll suggest to have a checkbox on your lead record which will be something like "Next activity" and when the sales rep checks it, it will create the next activity and uncheck the box.
    Otherwise, try to fin out if this kind of functionnality will be possible in the next release (R16)...
    Hope this will help, feel free to ask more !
    Max

  • Master and Slave Loops

    I'm having problems with my Master and slave loop combination.  I would like to be able to start and stop acquiring data from individual thermocouples. Please help.
    Message Edited by nicholas03 on 04-13-2008 03:22 PM
    Attachments:
    eight thermo.JPG ‏106 KB

    Dear Nicholas,
    My first advise would be to check the examples on master-slave patterns, and run them step by step, looking at what the data does...
    In a master-slave system, you use the queue to pass data from the master to the slave.   You're not passing data in the queue... in stead, you're passing data using local variables, which you should NOT do...  
    In the top loops, you should attach the temp array to the enqueue element.   In the bottom loop, you should remove the temp local, and instead get your data from the dequeue vi.
    Also, you have to create a queue with the proper variable.   You can create a queue from any variable type, but it has to know beforehand, and the init vi.  
    Assuming you want to queue the temp array, you're basic structure should look like this:
    It does help if you add your own code, so we can easier edit it for you...  Otherwise we need to use photoshop on your design...
    Message Edited by Anthony de Vries on 04-14-2008 11:30 AM
    Attachments:
    master-slave1.JPG ‏24 KB

  • How to create and share streaming video?

    Hi -
    I have finally finished a project in PE8 and I'd like to upload it to my website so that others can stream it.
    I have created output in FLV, MOV and MPG formats.
    I have uploaded them to my web server.
    However, whenever I link to the video, my browser (IE or Firefox) just asks to download or run it.
    Then, it tries to download the entire video - this is a problem as the files are up to 1.3gb.
    I've tried this:
    <html>
    <a href="myvideo.flv">CLICK HERE</a>
    </html>
    and this:
    <OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
    CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab" WIDTH="160" HEIGHT="136" >
    <PARAM NAME="src" VALUE="myvideo.mov" >
    <PARAM NAME="autoplay" VALUE="true" >
    <EMBED SRC="myvideo.mov" TYPE="image/x-macpaint"
    PLUGINSPAGE="http://www.apple.com/quicktime/download" WIDTH="160" HEIGHT="136" AUTOPLAY="true"></EMBED>
    </OBJECT>
    and this:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="400" height="400" >
    <param name="movie" value="myvideo.flv">
    <param name="quality" value="high" >
    <param name="LOOP" value="false">
    <embed src="myvideo.flv" width="400" height="400" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></ embed >
    </ object >
    So, why isn't it streaming?
    Is it the video format?
    The embedding on the web page?
    My server?
    Perhaps you can share the details of how you created and setup a streaming video?
    Thanks....

    You need to embed a player for the file. This will differ by the file type that you choose. I'd probably go with a Flash player, but you have other choices.
    I'd post your request for the exact instructions, and HTML code needed, plus tips on optimization to the Muvipix "Community," probably under the "Water Cooler" sub-forum. The Webmaster there, Ron, is an expert in embedded players, as are several other subscribers. I'll bet that you'll get the exact code, with all sorts of useful tweaks, in no time. If Ron suggests another file type and player, listen to him, and not to me. I just deliver the streaming AV files in the exact format that my client asks for. They have their Webmaster use them in their particular page design. My job ends, before your's, now, begins.
    Good luck,
    Hunt

  • How to create an infinite loop that cannot be cancelled?

    Hi , im new around java and i need a program that keeps on repeating after each each input/uses(generally meant for different user) and cannot either stop using "Cancel" or "x" while stopping only using the "stop" button
    I got a few lines of codes that look like this : String arg = "";
    do{
    JOptionPane.showInputDialog("hi");
    }while ( arg != "y" || arg!= "Y");
    and it cannot be stop with both cancel and"x"(which i wanted)
    but when i used this logic with
    Valid validUserInput = new Valid();
    do {
    userInput = validUserInput.validUserInput(a);
    switch(userInput){
    case 1 : validUserInput.optionOne(b);break;
    case 2 : validUserInput.optionTwo(c);break;
    case 3 : validUserInput.optionThree(d,e);break;
    default : validUserInput.validUserInput(f);
    }while(looping != "" || looping != " ");
    it does not really work(while it will keep looping, it can be easily stop by pressing cancelled or "x")
    So is there any logic or method that can prevent the program from being stop?
    Thankyou!

    elricscript wrote:
    "That is helpful. It gives him a direction where he can focus his research. Namely, 'how to run a program in kiosk mode' rather than 'how to create an infinite loop that cannot be cancelled.'"
    No... He already mentioned he wants to "e.g Interactive kiosk", so saying "properly kiosk it" isn't adding any new information. Rather it's just giving the person a dead point of: you're doing it wrong. Pointing out someone is wrong is not a positive enlightenment. Pointing someone in the right direction is more productive.
    >"That is helpful. It gives him a direction where he can focus his research. Namely, 'how to run a program in kiosk mode' rather than 'how to create an infinite loop that cannot be cancelled.'"
    No... He already mentioned he wants to "e.g Interactive kiosk", so saying "properly kiosk it" isn't adding any new information.
    Yes it is. He asked how to do it using some Swing trickery, and I said it won't work. Which is true. The OP didn't already know that, clearly, hence the question. Now he does. That's pretty much new information if you ask me.
    Rather it's just giving the person a dead point of: you're doing it wrong.Right. He is. However, the problem is now no longer related to Java, and not something I can help him with. You should try that: not answering questions you don't know the answer to. It's actually more helpful than posting misleading, wrong answers.
    Pointing out someone is wrong is not a positive enlightenment. I'm giving basic technical help, not yoga lessons.
    Pointing someone in the right direction is more productive.As already stated, I am as ignorant of how to make a Java application into a kiosk app as the OP is. What value can I add in light of that information? I began by answering a question that was not stated to be about kiosks. Once the question moved outside of my area of knowledge, I stopped trying to answer.
    I notice you're not giving him any help, being more interested in admonishing others as you are.

  • How to stop info and start loop over when file not found.

    I have a program that I want to run in a loop as long as there are files in a certain dir. When all the files have been read they are moved to another dir. I want this program to have a continuous loop but when the "read characters from file.vi" is send a "Not a Path" I dont want to be prompted for a file because there can be no user interaction. When my program has read and anylized all the data, I want it to keep going in a loop so when more files are put in this dir it will read again.

    Hi,
    create a while loop and use the file/directory-info vi (file i/o ->
    advanced) to get the list of existing files. If files exist (case structure)
    iterate through every one by using a for loop. Now you can read all files
    and when finished move them into the new directory. After that you can
    analyze the whole data. At last leave the case to wait until the next files
    are stored in the directory. Cause you used the file/directory-info vi, you
    won't get the dialog!
    hope that will help
    Henrik
    Bobca schrieb in im Newsbeitrag:
    [email protected]..
    > I have a program that I want to run in a loop as long as there are
    > files in a certain dir. When all the files have been read they are
    > moved to another dir. I want t
    his program to have a continuous loop
    > but when the "read characters from file.vi" is send a "Not a Path" I
    > dont want to be prompted for a file because there can be no user
    > interaction. When my program has read and anylized all the data, I
    > want it to keep going in a loop so when more files are put in this dir
    > it will read again.

  • How to create a button loop until mouse is released?

    How would I go about creating a button loop that continuously increments while the button is being pressed and stops incrementing on release?

    Just want to post the finished code for anyone who is interested.
    var interval;
       var count=0;
    //PlayerCastBar
      //Bar
       //X Pos
       i_Mercinova.PCBBXPDecrease.onPress = function()
         interval=setInterval(incrementPCBBXPDecrease, .01);
        function incrementPCBBXPDecrease()
         count++;
         _root.playercastbar.i_Castbar._x=(_root.playercastbar.i_Castbar._x-2)
       i_Mercinova.PCBBXPDecrease.onRelease = function()
         clearInterval(interval);
         count==0;
       i_Mercinova.PCBBXPIncrease.onPress = function()
         interval=setInterval(incrementPCBBXPIncrease, .01);
        function incrementPCBBXPIncrease()
         count++;
         _root.playercastbar.i_Castbar._x=(_root.playercastbar.i_Castbar._x+2)
       i_Mercinova.PCBBXPIncrease.onRelease = function()
         clearInterval(interval);
         count==0;
    It does exactly what I wanted it to.  Again, Thank You Very Much, Ned!! 

  • Can't create projects with loops longer than 1 second

    This is weird - In garage band, if I try to drag and drop one of Apple's pre-made loops into a new project and that loop is any longer than one second I will get the following error message:
    Result Code = -5000
    File = GarageBand-Temp-21B25E84.tmp
    (the temp file name, of course, changes each time)
    I have used GarageBand for years with no problem. I have upgraded to Lion a couple months ago. However, I have also upgraded GarageBand. Currently running version 6.0.4 (427.84).
    Very frustrating. Anybody have any ideas how to resolve?

    Finally called Apple and got it figured out
    1. Went to a new user and tried creating a GarageBand song there. That worked so isolated that it was some kind of problem with the user account
    2. Went back to user library and looked at Preferences again. Threw out all of the following (which I had done previously)
    com.apple.garageband.cs
    com.apple.garageband.LSSharedFileList.plist
    com.apple.garageband.LSSharedFileList.plist.lockfile
    com.apple.garageband.plist
    com.apple.garageband.plist.lockfile
    Also threw out (which I had not done previously)
    com.apple.iApps.plist
    com.apple.iApps.plist.lockfile
    In the process found a bunch of other files that Apple thinks were created in error during upgrade. All started with com.apple.iApps.plist.xxxxxxx (X's represent random alpha numeric sequences). Threw those all out
    3. Also, in user library, went to Caches and threw away com.apple.garageband.
    4. Restarted computer
    Problem solved.

Maybe you are looking for

  • Battery is always heating up.. :(

    what should i do? should i get another battery because my battery is always getting heated up.. help me....

  • Music was lost from a manual sync. how do you get it back ?

    did a manual sync to try an sync an ipod touch. music that was currently on their has been lost. how do you get it back? how do you sync from computer to ipod also

  • Prefrences for Mail has limited options

    i want to change my font style and size for all outgoing e-mail. In mail help it says go to prefrences. But in my mail prefrences I only ahve the ability to add accounts, then mailbox behaviors which is send, delete, trash etc. and advanced ahs more

  • Multiple Tax in an Invoice

    Hi All, Please i need to know how i can implement the following:- i want to implement tax in an Invoice document in such that i can deduct 2 separate tax and also Witholding Tax at Payment level. i. e . 1. VAT - 5% of Net at Invoice Category -> link

  • Right-To-Left on Windows 2000

    Hellow I have a problem cnverting my report direction from LTR to RTL Direction. What do u suggest?? I changed NLS_LANG to many settings. But Won't Work !! If u have a suggestion .. please help. Regards