Indent each paragrath in the text

Hello guys,
Can you help me out?
I am creating a program that read from text file A and write to text file B with each new paragraph indented 3 spaces.
import java.io.*;
          public class Paragraphs {
          // create two File Streams
          public static BufferedReader inFile;
          public static PrintWriter outFile;
          //main method of the program
public static void main(String[] args) throws IOException {
// create two file
inFile = new BufferedReader(new FileReader("his.dat"));
outFile = new PrintWriter(new FileWriter("d.out"));
// read file and write it to another
int b;
          while ((b = inFile.read()) != -1)
outFile.write(b);
// close files
inFile.close();
outFile.close();
}

That's an updated code that reads the text line and outputs it on the screen.
Still struggling with inserting spaces before the new paragraph begins.
import java .io.*;
class IndentAParagraph {
public static void main (String[] args) {
     try {
     File myFile = new File("h.dat");
          FileReader fileReader = new FileReader(myFile);
          BufferedReader reader = new BufferedReader(fileReader);
          String line = null;
          while ((line = reader.readLine()) != null) {
          System.out.print(line);
     reader.close();
} catch(Exception ex) {
               ex.printStackTrace();
}

Similar Messages

  • The icons in the bookmark tool bar are blank and the text that use to be below the icon is gone. I now have to cursor over the blank icons to see the text and the one I want. Can the icon/text customization be returned?

    In the Navigation Toolbar, the icons "Back", "Forward" etc. show the small icon and the descriptive text below the Icon. My Bookmark Toolbar use to have the same icon/text format but at some point, possibly a browser update, that changed. Currently, I do have a visible Bookmark Toolbar BUT the icons do not show the website icon, as previously, and the text below each icon is gone. I an cursor over each icon and the text becomes visible next to the icon. This is a bit of a pain to find a bookmark. Can I do a customization to return to the icon/text format.
    Was this changed because browser users requested this option, or was it an internal decision.? If the later why make such changes when not requested?
    Ed Sander

    That wasn't a change in Firefox. It sounds like something is broken in your Firefox installation, or you are misunderstanding the different between the Bookmarks Toolbar and the other Toolbars.
    In the Bookmarks Toolbar the text appears next to the website icon, not below the icon as with the other two Toolbars, and it's not switchable between text and no text as with the other Toolbars. With both the bookmark icon and the Bookmark name missing, something is broken in your installation. You need to do a little troubleshooting.
    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]
    If your problem isn't related to an extension, your bookmarks data base file (places.sqlite) is probably corrupt. <br />
    http://kb.mozillazine.org/Locked_or_damaged_places.sqlite <br />
    Be aware that if you delete the "places.sqlite" and similar files, your bookmark website icons won't automatically appear (the JSON backups don't have that icon data) when you restart Firefox and the places.sqlite is rebuilt using the backup data file, but the icons should be saved the first time each bookmark is used for the first time.

  • Saving the text in text editor changes text line format

    In my program I have an output witha  text editor box where
    we type in text and save , and if we want to print it it prints it out
    on a smartform. When I type in a text on the text editor box for example :
    "This will include a policy and best practice for
    what files can be stored on the server and where
    they should reside. The policy will include
    required ownership of each folder and required
    authorizations for access to folders. Also
    included in the policy will be a section describing
    best practices on the file and folder naming
    conventions. Anew file struicture of the drive that
    better aligns with the business. An drive with only
    four folders at the root level also will be de"
    After I type in this text in teh text editor and try saving it
    , it save sthe text but shows up with lots of gaps like below.
    "This will include a policy and best practice for
    what files can be stored on the server and
    where
    they should reside. The policy will include
    required ownership of each folder and
    required
    authorizations for access to folders. Also
    included in the policy will be a section
    describing
    best practices on the file and folder naming
    conventions. Anew file struicture of the drive
    that
    better aligns with the business. An drive with
    only
    four folders at the root level also will be de"
    I am not preety sure why on saving teh typed text it chnages to this format.
    I would like to have my program save it as is typed. Is this possible to do so
    and how?
    Thanks.

    Hi Aarav,
    Check the internal table used to store the text is having line length 100. Change that to 200 or more . You can see the difference . If still the problem persists, enter each line in the text editor and conclude each line with a carriage return( ENTER ) 
    key press.
    Hope this will help you.
    Regards,
    Smart Varghese

  • I uploaded the new firefox and all of my texts and pictures became small. ive tried the zoom, enlarging the texts, and even add-ons and nothing is working. how can i get it back to were it was before i downloaded the new firefox?

    ever since i uploaded the new firefox i cant get my texts and pictures back to the size i had them before. ive tried everything i could think of to get this problem fixed. now my texts are running into each other because the texts windows are so small and the texts are so large. i love firefox but ever since i uploaded this new one i cant use it.

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    * http://kb.mozillazine.org/Zoom_text_of_web_pages
    You can use one of these extensions to adjust the default font size and page zoom on web pages:
    * Default FullZoom Level - https://addons.mozilla.org/firefox/addon/6965
    * NoSquint - https://addons.mozilla.org/firefox/addon/2592

  • How can i get back the text of child

    I did an application to connect a db and show the datas in table.but the text of all such as button or textview seems disappear.how can I get them back?
    Here's the snap picture of my problem.
    http://img191.photo.163.com/rocboy_yang/13457324/655578057.jpg

    Hello Ty Lu,
    Have you hardcoded the text values for each button in the 'text' property of each button or are they assigned programaticaly from the context, are you using the message pool, perhaps for translation?
    Perhaps just right-clicking on your project in NWDS and selecting 'Reload' will straighten things out for you, give it a try.
    Regards,
    Patrick.

  • I have an email thread that has become unprintable (and in some cases unreadable) because each email in the thread is indented and eventually the text is very far to the right margin and even beyond.  How do I correct this?

    I have an extremely long and important email thread that has become unprintable (and in some cases unreadable) because each preceding email in the thread is indented and eventually the text is very far to the right margin and even beyond.  Some of the text is even showing up as only 1 letter per line.  I tried selecting all and then left justifying it, thinking that that would shift everything to the left, but it didn't work.   When I go to print the thread, it shows as 344 pages, which although long, I can't believe it's that long.  What do you think happened to cause this and can it be corrected?

    Ick. So it can't just work sensibly? Sensible would be either autosave overwrites previously autosaved versions or all autosaved versions would be deleted when the message is finally sent. Allowing previous message versions to accumulate endlessly might be beneficial to someone, but does not seem like sensible default behavior.

  • On some pages the text from more than one paragraph stack up on top of each other, like writing something then writing something else on top of it.

    On some pages the text from more than one paragraph stack up on top of each other, like writing something then writing something else over the top of it. Some pages will run text and pictures together, like a car rear-ending another or a train pile up. Other pages will cut an image or text short, i.e. it will display a portion of the top of the image or text but not the rest. This happens on Amazon for example, the section where it says "Customers who looked at this also looked at" will allow only a certain amount of the upper portion of the description immediately below the picture of the product but below that section everything is fine until I get to another section displaying more products and their descriptions and then it cuts the bottom portions off again. I've noticed this behavior mostly in the sections with product photos, the text sections seem okay. YouTube also displays this behavior. It's even doing it on this page right now. Below this box I can read "The more information you can provide the better chance your question will be answered " , but directly below that in the next sentence I can see the start of it with "Troublshootin" and the "Automatically Add" in a green field covering the "g". The next clear text is "A window will open in the top corner. Click Allow, and then click Install. If the automated way doesn't work, try these manual steps." I tried turning of pre-fetching, clearing history, cookies, and cache, scanning for malware with Avast and Windows Defender all to no avail. It began when I upgraded from dial up to DSL via AT&T Uverse. I have a Motorola NVG510 modem. The modem was replaced an hour ago along with new dedicated lines and DSL/Phone splitter from the box by an AT&T technician to make sure my incoming lines were up to par. He ran a connection test and verified everything is up to standards. IE does not display this behavior. I am running Firefox20.0.1 and all previous versions have acted the same way since I upgraded to DSL about 3 months ago.

    If you have increased the minimum font size then try the default setting "none" in case the current setting is causing problems.
    *Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    Make sure that you allow websites to choose their fonts.
    *Tools > Options > Content : Fonts & Colors > Advanced: [X] "Allow pages to choose their own fonts, instead of my selections above"
    It is better not to increase the minimum font size, but use an extension to set the default page zoom to prevent issues with text not being displayed properly.
    You can use an extension to set a default font size and page zoom on web pages.
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • Text put into a canvas element with context.fillText() always has a black box where each letter goes. If the text is black you just see the black rectangle. If the text is not black you see it on the black bounding box. Surely this is not right.

    This has happened on the last few versions of firefox, as long as canvas has been supported. I see other people's screen shots from canvas tutorials, and the text always looks normal. On my system, any text put into a canvas element via context.fillText() will have a black bounding box for each letter, sized appropriately for the letter. If the text is black, of course you only see rectangles. If the text is a contrasting color, then you can read it, but it looks bizarre.

    Thomas...same kind of crap here.
    I used Custom Text - entered a sentence, hit return, entered another.
    Set to 72 pt.
    The default alignment is centred - I want left aligned text...the text start point stays at the centre of frame and the sentence runs off the edge of the bounding box.
    There is no settings in the Text or Title inspector dialog to correct that!
    Using Transform will not sort it!

  • Creating 3 links each with pop-up text box on the same slide

    Hi,
    I'm trying to create a slide that has 3 links and each link has a pop-up text box. I do not want to separate the pop-up text into separate slides. I have it so that there are 3 click boxes and each have the action "show" the proper text box. I also created another click box that acts as a close button where the action is to hide the pop-up box. I have an extra click box hidden on the page to make sure the user stays on the page and not automatically advance.
    Once I have the user click on the first "link" it shows the text box. Once the user clicks the close click box it takes the user to the next slide. I just need it so that it shows the user the pop-up text and then when the user closes the pop-up and returns to showing the 3 options/links. So it basically refreshes the slide instead of going to the next slide.
    Thanks,

    This will be a little tricky to achieve. This is because per default Adobe has decided that any interactive object (like a button or a click box) that has a user defined action on it (like continue, pause, open URL etc.) automatically continues to play the project when clicked.
    Therefore when you click your button it will show your textbox, but it will also continue to play on your timeline.
    You can read some more about it here: http://forums.adobe.com/thread/479725?tstart=0
    I did something similar to what you want one time and I just created a bunch of click boxes and made them very small and put them in a corner. The click boxes were placed on the timeline with 0.2 seconds between the pauses. Then I created my "real" buttons to show/hide the text boxes and placed them on the timeline before the other click boxes.
    The result is that once a user clicks your button it will show the text caption you want - continue on the timeline and pause at the first click box. When they click another button the same will happen. Just make sure that you have a lot of click boxes (I think I put like 30) and make sure that your navigation button for advancing to the next slide is set to "go to next slide" and not "continue" as that would make it pause at all your click boxes as well.
    /Michael
    Click here to visit the www.captivate4.com blog

  • How can I select and enlarge the entire doc,ge on a page, reducing the surrounding boarder.  I can move the difference text boxes about independently of each other but the outer most boarders of the main template block appear to be fixed.

    How can I select adn enlarge the entire document/image on a page, reducing the the surrounding boarder?  I can move the different text and image boxes around independently of each other but the outer most boarders of the main template block appear to be fixed.  I thought I would be able to enlarge or reduce my document from 'page layout' but this does not seem possible.

    Inspector > Document > Document Margins
    The word is border. Boarders are the Harry Potters of this world.
    Peter

  • I did a COPY of some text from a web page, and then did a PASTE into notepad.exe (Windows). The text from each line was duplicated -- on the line! Instead of "Fred", it became "Fred Fred".

    I just recently installed Firefox for the first time. It seems nice and quick. The version is reported as: "10.0.1".
    I wanted to save some text from a web page, so navigated to that page, selected the text, and pressed the Control-C combination to COPY the selected text to the buffer. For example, the text I selected looked something like this:
    Harry
    Ron
    Hermione
    Hagrid
    Albus
    NOTE: Each line of text has a small icon to the left of the text.
    It is not reasonable to COPY and PASTE each line individually, as there can be hundreds of lines of data. I recall, however, that
    doing a COPY and PASTE on this data into Microsoft's Excel will produce cells which have the icons included in the cell, but unfortunately one cannot can't get rid of them! At least I've never found a way to remove them, but that's another issue. :)
    Once I'd done the COPY operation I switched to a Notepad window and did a PASTE operation. To my surprise, the text from each line was duplicated. It looked like this:
    Harry Harry
    Ron Ron
    Hermione Hermione
    Hagrid Hagrid
    Albus Albus
    Thinking that there might be something unusual about the web page I looked at the source, but it appeared "normal" -- that is, as expected.
    Note: I have done this operation several times before, and have never seen this occur before.
    Note: In the actual data some of the lines have quoted text in them. Curiously there is weird behavior on these lines. In some cases the entire line is shown only once. (These occur at the top of the line, and the quoted text is at the beginning of the name.)
    When quoted text appears "later" in the name, in some cases the quoted text is duplicated, and in other cases the quoted text is missing altogether! I have also noticed an error with the quoted text, and so will be reporting that to the web site which generates the HTML.
    Note that each line of "text" is "anchor text", so if I click on a name the browser navigates to a page for that name.
    I believe that the problem is that the COPY operating in Firefox is not simply copying the visible text, but also the ALT=
    Below is a sample of what the source HTML looks like:
    &lt;a class="lnk" target="_blank" href="http://details.aspx?id=Harry">
    &lt;img width="16" height="16" alt="Harry" class="tb_icon" src="http://.../Harry.gif"/>
    &lt;span>Harry&lt;/span>&lt;/a>
    <br/>
    (Because of the true length of the lines in the source HTML, I have stripped out the actual URL of the site.)
    To make sure I wasn't imaging this difference I repeated the process within Internet Explorer. In that browser I did not get duplicated data.

    Try:
    *Extended Copy Menu (fix version): https://addons.mozilla.org/firefox/addon/extended-copy-menu-fix-vers/

  • Is there a way to annotate a PDF by adding a text box any where on the screen rather than having to click on the text box Icon each time? It was like this before I downloaded Yosemite.

    I use the Preview app to annotate my notes for class. It use to be where I could add text where ever I wanted on the screen just by double clicking. Now since I downloaded Yosemite I have to click on the text box icon at the top each time and it adds the text box in the middle and I have to move it to where I want it. This is very inconvenient for class. Any suggestions on how to get the old preview back or fix this problem?

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback

  • Read the first word of each line in a text file

    i need to read the first word of each line of a text file.
    i know of line.split() but not actually sure how i would go about using it
    Any help most appreciated
    Many Thanks
    Ben

    Hi thanks for the reply!
    this is what i tried... and it still doesn't get me the first word of each line!
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.Color;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import javax.swing.text.*;
    import javax.swing.event.*;
    import java.util.Calendar;
    import java.util.Scanner;
    import java.util.Vector;
    import java.text.SimpleDateFormat;
    import java.net.InetAddress;
    import java.net.UnknownHostException;
    import java.io.BufferedReader;
    public class testing {
         Vector progs=new Vector();
         Vector rand=new Vector();
         String[] tmp = new String [2];
         String str;
         String str2="ewerwer";
         String str3;
         public void programTest()
                   try
                             BufferedReader in = new BufferedReader(new FileReader("progList.log"));
                             while ((str = in.readLine()) != null)
                                  progs.add(str);
                        catch(IOException e)
                             System.out.println("cannot read file");
         //////THE ISSUES IS HERE....I WANT TO GET THE FIRST WORD FROM EACH LINE OF THE FILE!!!     
              try
                             BufferedReader in2 = new BufferedReader(new FileReader("eventLog.log"));
                             while ((str = in2.readLine()) != null)
                                  tmp = str.split(" ");
                                  System.out.println(tmp[0]);
                        catch(IOException e)
                             System.out.println("cannot read file");
    public static void main(String[] args)
                 testing B = new testing();
                 B.programTest();
               //  B.fileToVector();
                 //B.LoginWindow();
               //B.anomDetect();
    }//end class

  • Changing the text in each dataGrid row to a different color

    Okay I am going to try and be as clear as possible with this,
    so bare with me.
    What I am trying to do is make it so that when my
    arraycollection objects that I have retrieved from a web service
    are loaded in (by using the "dataProvider" attribute) my dataGrid
    that some sort of code will take place changing the color of each
    line of text (all the objects stored in the array collection are
    string types) and display each rows text in a different color.
    Now after looking into it, it seems the only way to alter the
    color of the text is to use some sort of style or format but it
    seems it only effects text in a "textArea, textField, textInput"
    etc... SOOO I figured why not create a itemRenderer that contains
    one of those and put it into the dataGrid... Which I did and still
    can't figure out a way to make it so you can dynamically alter the
    color based on a set of rbg values stored in a array the same size
    as the rowCount of the datagrid.
    so I am rather stumpped in what to do.. I DON'T want to
    change the background color of each row, so alternatingItemColor is
    out of the question, I just want the text displayed in each row to
    be a different color.... And I want all this color changing to
    happen either before the data is inputted into the dataGrid
    (manipulating the arraycollection some how..) or when its all
    already in there, it all needs to happen in code no user
    interaction.
    I was thinking perhaps maybe I could create a item Renderer
    object that contains the compenent (the textArea in it) and just
    make a array of item Renderer objects and pass those into the
    dataGrid, but I don't think that is possible.
    ANY IDEAS AT ALL!! On how to change the color of the text in
    each row of the datagrid to a different color would be a HUGE,
    HUGE!!! help. Or any info on how to setup a datagrid listener that
    listens for when a object (a row) from the arraycollection is added
    to the datagrid... Perhaps I could use that info some how to my
    advantage.
    email me, if you like I don't care I just need a answer to
    this its driving me crazy! I can change the background row color
    based on a array of rgb values but I can't change the color of the
    item in that row based on array of rgb values, ARG!
    [email protected]
    thanx in advanced.

    <mx:itemRenderer>
    <mx:Component>
    <mx:Label color = "red" />
    </mx:Component>
    </mx:itemRenderer>
    want to make it so I can change the color of the label on the
    dynamically by calling some sort of method I have created.. is that
    possible? if so coudl you please give a example, thanx!

  • I just loaded the 'lion' now my mail takes a new life....how do i move the reading panel to the bottom / also how do i get rid of the text/content under each mail..two simple things not sure obvious on this version !!!

    i just loaded the 'lion' now my mail takes a new life....how do i move the reading panel to the bottom / also how do i get rid of the text/content under each mail..two simple things not sure obvious on this version !!!

             

Maybe you are looking for

  • Error when scheduling the report

    hello: I have a workbook when i schedule it, it gives me the following error ORA-04063: Package body "SYSTEM.EUL5_BATCH_USER" has errors ORA-06508: PL/SQL: could not find program unit being called: "SYSTEM.EUL5_BATCH_USER" ORA-06512: at line 2 The on

  • IPod touch apps will not open

    my brothers iPod touch will not open up app store apps. we have tried to reset the iPod, but the apps still not open. it looks like the apps are trying to open, but something is stopping them form doing that. what can we do????

  • I want to cancel Creative Cloud ... but can't get through to the gatekeepers

    Like so many others I've been tearing my hair out in an effort to cancel Creative Cloud, which has never worked on my computer. I tried the 1-800 number, but after costing me a lot of money (due to long waits and a per-minute charge on my phone plan)

  • How to Map a .txt File To Process Scheduler Output In Peoplesoft

    Hi, My Requirement is to map the Output file (*.txt ) to the report repository (Log/Trace). Please let me know if this is possible in PeopleSoft.

  • Lightroom 5.7  Lens Correction

    i have lightroom 5.7 but the Lens Correction area is not showing in my develop module - does it have to be enabled somehow?