Reading in one line at a time.

How can I read one line at a time?
String sData = "One large string"
StringReader reader = new StringReader(sData);
StringBuffer buf = new StringBuffer();
String line = "";
while ((line = reader.toString()) != null) {//This line does not read one line at a time. Is it possible to do the with StringReader?
StringTokenizer tok = new StringTokenizer(line, "|");
Thanks:0)

The following code snippet does what you want :-)
        String test = new String("testString \n with \n multiple lines");
        StringReader strReader = new StringReader(test);
        BufferedReader strBufRdr = new BufferedReader(strReader);
        String line = null;
        try {
            while((line=strBufRdr.readLine())!=null) {
                System.out.println(line);
        catch(IOException e) { System.out.println(e); }Have fun!

Similar Messages

  • How can I display one line at a time on a PPT slide

    I am using OFFICE for the Mac (2008).
    In the past, I have known how to do this using PPT on a Windows PC..
    But something has changed and I can no longer figure out how to get each line on a PPT slide to appear one line at a time every time I click it.
    It's not that difficult, but I can't figured out where they moved the "Appear" option.
    I am NOT using KEYNOTE, but PowerPoint from OFFICE for the Mac (2008)
    Can someone help me.
    Thanks,
    Tom

    Since this is a Keynote discussion forum, there may be no one here that knows. I personally hate PP and could care less about how to make one line display at a time. It is easy on Keynote and that is all I need to know. You might want to look for a PP forum and ask there.

  • How do I scroll more than one line at a time in Firefox 4? Scrolling with down-up keyboard arrows is much faster in IE/Chrome.

    I have tried using about:config options mousewheel.withnokey.sysnumlines > false and custom set mousewheel.withnokey.numlines, but it makes a difference only when I use a mouse, which I don't use most of the time on this laptop. I use down/up keyboard errors to scroll, and the page scrolls one-line-at-a-time, very slow and lagging. Is there a way around this?
    I have reinstalled Chrome as secondary browser only because of this, FF4 otherwise really kicksass. Thank you for an amazing browser and any feedback on my issue.

    Well I am using those, but it is not very practical. What puzzles me is that only Firefox has this behaviour, I have tried last versions of IE, Chrome, Opera - all three scroll much faster than Firefox 4 using down/up keyboard arrows.
    Thanks for the reply, I really hope to get a solution to this.

  • How do I scroll one line at a time in Lion?

    I want to upgrade to Lion but need the functionality of the scroll bar arrows. I have learned that the functionality of the arrows is part of the core operating system and is not being replaced. Any suggestions as to any add-on devices that would allow this function?
    Thanks,
    Rich

    If the program/window is not a text-based one (such as a word processor), you can usually use the up and down arrow keys to scroll up or down one line at a time.
    There are often mods to this behavior, but exactly what depends on the program. Test with the up and down arrow keys in conjunction with the usual modifier keys - Shift, Command, Option, etc.

  • Make image appear one line at a time

    I have an image of a seashell that I created in Photoshop.
    It's just black and white outline of an image. What I want to do is
    reveal this seashell image one line at a time. I tried creating
    motion paths but only part of the image is visible at any given
    time, the image doesn't get revealed toward the end. Any help would
    be greatly appreciated.
    To give an idea of what I mean, this link here will show
    that:
    http://www.flashforwardconference.com/past_winners
    . Once on the page click on the link "Type Drawing" next to the
    words Typography:
    Thank you,
    ar

    I'd suggest masking the image layer and then using whatever
    form of animation (tweens, brute force, etc) works best to reveal
    the image through the mask. If the image is organic in nature (and
    assuming that you don't just want to reveal it top to bottom like a
    scan) then probably hand drawing onto the mask frame-by-frame is
    the best way (although this adds a lot of keyframes).

  • Utility to send text file over GPIB, one line at a time?

    We are developing instrumentation that receives data and commmands over GPIB as plain text, and returns them as well. I'd like to create GPIB "batch" files and send them over the bus, one line at a time, so I can debug the instruments' behavior. I'd also like to be able to read back responses, one line at a time.
    Is there such a utility? I've got our programmer working on something like this, but I'd hate to have him re-invent an existing wheel.
    Thanks!

    Apart from NI-SPY, I have not heard of such a utility. This may be simple to implement using proper termination. If the instrument is capable of sending line feeds or carriage return, you should be able to easily create a document. Also, using IBWRTF, you could write the ASCII file (containing the termination characters) to the bus. Depending on how you have your timeouts specified, this may be ideal.
    Alternately, if you read a static amount of data, you could IBRD chunks of data. the result may need editing for broken words at the end of a line but would achieve such a result.
    Ryan Mosley
    National Instruments, Applications Engineer
    http://www.ni.com/exchange

  • Photo printing slow one line at a time

    My first time printing phots on my Officejet 4620 and it is taking 20 minutes per picture one line at a time. Very frustrated. Call the help line and was told tht how this printer works.....

    Many things can affect printing photos. Wireless connectivity (if applicable), paper size, print quality, software used to print the photo, printer design optimization (photo printer vs. office printer), security software used on your computer,  etc.....
    That being said, this photo printing document may offer some information of benefit:
    http://www.hp.com/united-states/consumer/digital_photography/print_better_photos/tips/printer-settin...
    007OHMSS
    I was a support engineer for HP.
    If the advice resolved the situation, please mark it as a solution. Thank you.

  • Fillable pdf's returned by clients are readable only one line at a time

    We have been emailing fillable pdf questionnaires to our customers for them to complete and return via email.  When some of them have come
    back, they are only viewable one line at a time, we need to highlight the fillable field that the customer completed so we can view their answer.
    Does anyone know why this occurs and why it would be isolated to a few cases?  Thanks!
    George

    They were probably filled-in and saved with the Preview application on the Mac. For more information and some approaches you can take to correct, see: http://kb2.adobe.com/community/publishing/885/cpsid_88564.html

  • Listbox one line at a time

    I want to add one line at a time in listbox/textbox just like InsertTextboxLine funtion in CVI. I can not find similar VI in labview. I think I can do it long way...by saving listbox to an array then append my line at the end of the array and send updated array to listbox..these are lot of steps to add one line to listbox/textbox...
    Any help would be appreciated.
    Thanks.
    CVI 2010
    LabVIEW 2011 SP1
    Vision Builder AI 2011 SP1

    Actually, the way to append an item to a list box is to create an Item Names property node for the list box.  Then you can use Insert Into Array, and write to another property node for Item Names.
    Message Edited by tbob on 10-03-2005 02:31 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    ListBox.PNG ‏3 KB

  • Read data from a text file, one line at a time.

    I need to read data from a text file, and display each line in a String Indicator on Front Panel. It displays each line, but I get Error 4, End Of Line, unless I enter an extra line of data in the file that I don't need. I tried Read From Text File.vi, made by Nat Instr, and it gave the same error.

    The Read from Text File.vi reads data from a text file line by line until the user stops the VI manually with the Stop button on the front panel, or until an error (such as "Error 4, End of file") occurs. If an error occurs, the Simple Error Handler.vi pops up a dialog that tells you which error occurred.
    The Read from Text File.vi uses a while loop, but if you knew how many lines you wanted to read, you could replace the while loop with a for loop set to read that many lines from the file.
    If you need something more dynamic because the number of lines in your files vary, then you could change the code of the Read from Text File.vi to the expect "Error 4, End of file" and handle it appropriately. This would require unbundling the error cluster that comes fro
    m the Read File function with the Unbundle By Name function, so that you can expose the individual error "status" and error "code" values stored in the cluster. If the value of the error "code" is 4, then you can change the error "status" from true to false, and you can rebundle the cluster with the Bundle by Name function. Setting the error "status" to false instructs the Simple Error Handler to ignore the error. Otherwise, pass the original error cluster to the Simple Error Handler.vi, so that you can see what the error is.
    Of course, if you're not interested in what the errors are, you could just remove the Simple Error Handler.vi, but then you wouldn't see any error messages.
    Best of Luck,
    Dieter
    Dieter Schweiss
    Applications Engineer
    National Instruments

  • My mouse scrolls shows each line moving up instead of moving one line at a time annoying

    Since downloading firefox 3.6 when I scroll down a page it shows each line moving up instead of just moving one line up its very annoying

    It could be that there is not enough memory in the printer or the print server to hold the entire document while printing. The printer gets Postscript files, which are larger than the original document. Also, if you are doing multiple copies, if you collate the pages, that takes more memory than printing each page multiple times.

  • Why does pressing the down arrow button result in going to the bottom of the page and being nunable to go up or down one line at a time?

    i dont know what to say in way of clarification. when looking at a page i am forced to use the "slide" on the margin which is very sensitive on very long documents instead of the down arrow to move one line. pressing the arrow results in going to the bottom and you cant return using the arrow.

    The arrow to open the tab history of the Back and Forward buttons has been removed in Firefox 4 and later.
    Use one of these methods to open the tab history list:
    * Right click on the Back or Forward button
    * Hold down the left mouse button on the enabled Back or Forward button until the list opens
    You can look at this extension:
    * Backward Forward History Dropdown: https://addons.mozilla.org/firefox/addon/backforedrop/

  • How do I get Firefox to go back to scrolling one line at a time with the up/down arrow keys? I noticed this changed in Firefox 10 and I actually preferred the one line at a time, can this be an option in future releases?

    The title says it all, I'm not really sure if this is the proper place to post this as it's not a "bug" per se. I noticed on the list of bugs "fixed" in Firefox 10 scrolling more than one line with the arrow keys was one of them. I know a lot of people hated the one-line thing too so I'd suggest in future releases it should be a preference we can change.

    You can right-click either Back or Forward button to open the tab history list.

  • Why has my hp deskjet 2050 printer and scanner suddenly slowed down and printing one line at a time

    why has my hp deskjet 2050  printer and scanner suddenly slowed down and printing one line at a time

    This is usually indicative of a defective print cartridge.  Suspect the black is low in ink or defective.  Please check all cartridges. 
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • How do you advance one line at a time (text) within each slide?

    In PowerPoint you can either present an entire slide at one time or make each bulleted line in the slide appear line by line as you click the mouse button.
    I cannot figure out how to do this in Captivate. I am only able to advance an entire slide at one time.

    The easiest way would be to import the slides from PowerPoint using the high-fidelity import setting (assuming you're using Captivate 7 with a PC and a newer version of PowerPoint).
    The "all-Captivate" way is to make several full-slide transparent "buttons" that display one after the other, play for a set period of time, then pause until the next click. You'd then adjust the text box duration in the timeline, and add effects (if desired). (You could also use "continue" buttons, but full-slide buttons would better duplicate the PowerPoint behavior.)

Maybe you are looking for

  • WLC 4402 Update 7.0.253.3: all 17 APs use channel 1

    Since the update of our WLC 4402 to v 7.0.253.3 all 17 accesspoints are using channel 1 !! Has anyone an idea to solve this channel-fixing? Thx Markus

  • Documentation for USRP 1.1 with Ettus N210

    Where can I find documentation for using USRP 1.1 with the Ettus N210 device?  The documentation that comes with USRP 1.1 has a tiny blurb on the N210 that points to the documentation for NI 292x devices for details.  There, I find:    "For Ettus Res

  • Unable to connect to home network on my iPad 2.

    It's been working fine, until this morning. I reset the router (linksys), turned off MAC filtering. Wi-fi settings show "home", but Safari says not connected.

  • How to delete data definition form XML Publisher Administrator

    Hi all, I want to ask is there any possibility to delete existing data definition from XML Publisher Administrator responsibility? Version: 11.1.0.7.0 Regards, Alexander.

  • XML to drill down capability

    <p>Hello,</p><p> </p><p>I am a new Hyperion user so please forgive me if this is not theappropriate place for this question.  I have an XML documentwhich I would like to import to a Hyperion report.  Is itpossible to create a sort of "drill-down" rep