Capturing all the text that I output to the console

HOw do I capture all the text I output to the console to a file. I know how to open filebuffers and all that, well I don't really know, but I have some sample code that I can follow. I am just wondering if I am suppose to just open the file buffer, then run my normal application with all the system.out.println() statements and then have that fed to a file? Right now I am using a lot of println() statements to debug, and I would like to be able to push it into a file so I can look at it later, without having that console line limitation.
My guess is to just open up a filestream and have it open and then run my normal code and then close the filestream at the end. Can somebody let me know if that is good enough...
let say I have a static method hat outputs a bunch of text, can I do this
filestream open
static method run
filestream close
and that's it.

I could see why you'd want to automatically
route output to a file, that normally would
go to the console. There might be use for
capturing output lines.
If the question is to avoid having to specify
the output on the command line, then what
one can do is to create a ".bat" file.
Ex.
kstring.bat
======================================
@java kstring > kstring.out
Now in executing, you'd just ==> kstring
Which will execute the kstring.bat,
and since "> kstring.out " is inside
the "bat", your output goes to the
kstring.out, instead of the console.
This would be another way, saves all the
redirection in Java code. Just use the
DOS command inside a xxx.bat file.
Just my opinion, may not work in your
circumstance.
-- gte99te

Similar Messages

  • How can i AppendText to richTextBox only if the text is new(different) from the text that is already in the richTextBox ?

    Code
    public void ScrollNews()
    listsext.Ext(page);
    combindedString = string.Join(Environment.NewLine, ListsExtractions.myList);
    richTextBox1.SelectAll();
    richTextBox1.SelectionAlignment = HorizontalAlignment.Right;
    richTextBox1.AppendText(combindedString);
    scrollerText = string.Join(Environment.NewLine, ListsExtractions.myListWithoutLinks);
    scroller1.TextToScroll = scrollerText;
    if (NewsLevels.newsLevel && NewsLevels.shouldStart)
    UpdateTextControls();
    scroller1.Start();
    NewsLevels.shouldStart = false;
    if (NewsLevels.newsLevel == false && NewsLevels.shouldStart)
    UpdateTextControls();
    scroller1.Start();
    NewsLevels.shouldStart = false;
    string[] rlines = richTextBox1.Lines;
    richTextBox1.SelectionStart = 0;
    richTextBox1.SelectionLength = rlines[0].Length;
    richTextBox1.SelectionColor = Color.Red;
    richTextBox1.Select(rlines[0].Length, rlines[1].Length + 1);
    richTextBox1.SelectionColor = Color.Green;
    RedColorAlert1();
    if (lines == null)
    label5.Text = "0";
    else
    label5.Text = lines.Length.ToString();
    The line is:
    richTextBox1.AppendText(combindedString);
    I'm calling this method ScrollNews every X minutes with a timer.
    The way it is now it will AppendText all the time. But i want it to Add the combinededString only if the text in combindedString was different from the text that is already in the richTextBox. Somhow to keep all the time the last text and compare it and
    if there is a new text then appen it.

    public void Scroll()
    listsext.Ext(page);
    combindedString = string.Join(Environment.NewLine, ListsExtractions.myList);
    richTextBox1.SelectAll();
    StringBuilder sb = new StringBuilder();
    sb.Append(combindedString);
    richTextBox1.SelectionAlignment = HorizontalAlignment.Right;
    richTextBox1.AppendText(combindedString);
    The problem is that now it will keep adding to the richTextBox the content in combindedString over and over again. I need somehow to check each time if the content in combindedString already exist in the richTextBox if not meaning it's new content then AppendText
    it.
    If it's the same already exist do nothing don't add it.
    EDIT
    I write to a text file the content of the ombindedString variable .The first content the lines is the combindedString:
    המשטרה עצרה אמא ל2 ילדים קטנים שבעלה נעצר בחשד למעורבות בעלה בכריתת עצים
    15:03 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189935.shtml
    אדם החשוד בעבירת מין בקטינים נעצר לאחר שהתלונן על 2 שסוחטים אותו על רקע מעשיו
    14:50 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189932.shtml
    אינדונזיה: 5 הרוגים בקריסת האנגר בנמל תעופה
    14:44 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189930.shtml
    אום אל-פחם: מספר חשודים עוכבו בחשד למעורבות במימון טרור
    14:04 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189914.shtml
    אלמנתו של רפ''ק ג'דעאן אסעד, שנרצח בפיגוע הדריסה, ילדה בן
    13:05 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189884.shtml
    תנאי ליברמן לכניסה לממשלה עונש מוות למחבלים חובת חתימה על מסמך נאמנות
    12:39 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189868.shtml
    תלמיד תיכון מרחובות חשוד שהפעיל מעבדה ביתית לזיוף תעודות זהות ואישורי מחלה
    12:03 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189856.shtml
    הצביעות של רענן שקד: האשים את אמהות 3 החטופים ומגנה את חגי הוברמן
    11:43 דווח במקור בתאריך : 09.03.15 : שעה
    http://rotter.net/forum/scoops1/189848.shtml
    And this is a screenshot i couldnt copy the text of the richTextBox1.Text
    richTextBox1.Text content image
    co uld be that the format of the text in the combindedString and the richTextBox1.Text looks different so it think it's not exist ?
    Update:
    Not sure if it's important but the combindedString i'm adding the text to it from the variable ListExtractions.myList
    myList is List and i build this List like that:
    private void ListToStringList(List<string> myl)
    for (int i = 0; i < AllNews.Count; i++)
    myl.Add(AllNews[i].text);
    IFormatProvider provider = CultureInfo.InvariantCulture;
    DateTime myTime = DateTime.ParseExact(AllNews[i].original_time, "DyyMMddTHHmm", provider);
    string results = myTime.ToString("HH:mm דווח במקור בתאריך : dd.MM.yy : שעה");
    myl.Add(results);
    myl.Add(AllNews[i].link);
    myl.Add(Environment.NewLine);
    myListWithoutLinks.Add(AllNews[i].text);
    myListWithoutLinks.Add(results);
    myListWithoutLinks.Add(Environment.NewLine);
    for (int i = 0; i < myl.Count; i++)
    myl[i] = Regex.Replace(myl[i], @"\t|\n|\r", "");
    And use it:
    ListToStringList(myList);

  • I have a transparent picture in my document. How do I get the text, that is typed over the picture, to not fade in color? I want all the text to be the same black color.

    I am creating a form and would like to put the conference logo in he background. I added it and made it transparent but I want the text to not change it's shade of black when I type over the picture. Is there a way to make that happen?

    Insert your text in a text box which you will put above the picture.
    Yvan KOENIG (VALLAURIS, France) dimanche 25 septembre 2011 22:21:18
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community

  • How can I display the texts that the user just typed in?

    Hello all, I am  using Captivate 5.5 and I am trying to realize this function:
    Have a text entry box for the user to type in their answers (can be a paragph and up to 400 words etc.), then the user clicks on the submit button and they will be able to read what they just typed in on the left of the screen, and the sample answer given by the course.
    In order to realize this, I placed one text entry box and make the value associate to a customized variable of "log_1". Then I have two text captions:
    one named "log_1_answer" and inside of it I put $$log_1; the other one named "log_1_sample". Both text captions are set to invisible at the enter of the slide.  Then I have the advanced action for the submit button of the text entry box as "show log_1_answer; show log_1_sample; hide text_entry_log1"
    When I previewed it, I got all logistics work. However, the texts that were shown in the text caption of log_1_answer only were only 15 letters.
    I wonder whether there is a restriction for the length of variables in Captivate that we can display? If so, is there other possible ways that I can realize what I want to do?
    Thanks for any suggestions.
    Here is the screenshot of my stage: the biggest white one with the submit button is the text entry box. The box with red borders is the display box, and the blue gray one on the right is to show the samle answer by the instructor.

    Hello,
    When you insert the user variable, watch the length in the dialog box. Default is indeed 15 characters, you'll have to change that as I did in this example. Too bad, you cannot change it after inserting the variable.
    Lilybiri

  • How to change the font size of the text that is revolving ?

    Hi there,
    I am using the Revolution theme.
    How to change the font size of the text that is revolving (on the first menu page) ?
    Thanks

    You can't.  That's hard coded into the theme.
    OT

  • I installed Safari 7.1. Now YouTube videos have a bad font for all the interface text that is part of the video embed.

    Since installing Safari 7.1, all the text in YouTube videos (title, resolution, etc.) is all little font error boxes and therefore completely unreadable.  Nothing else is having this problem, just the text that is in the embedded videos themselves.
    Any suggestions?

    What I did (in this order) was, set YouTube to HTML 5, bring Flash up to date, fontrestore, clean font cache with Fusion, reboot.
    So far it has now remained fixed for me.  I have Mavericks and it is up to date.
    by ‘fontrestore’ I mean
         sudo fontrestore default
    in terminal as described on http://apple.stackexchange.com/questions/113107/how-to-restore-default-fonts-on- mavericks
    fontrestore removed some of my fonts from my System and Library, but I moved them all back in on the theory that I might want to add fonts, but was not looking to remove them.
    I don’t know which of these steps solved the problem.  All I know is what I did and what the result was for me.  As always, use ‘sudo’ at your own risk.

  • How do ya delete all the text that is a web link?

    i am not only looking to disable hyperlinks, i want to remove all the links including the text of the links.
    like i want all the text that is a link to the web to delete. because i want to text to speech the thing and it has many links. ie this is a twitter thread, and i want all links out of my text, because it makes no sense for me to listen to them and kind of weird to listen to them. i only want the text, no links, no text of links. not only disable the link from being blue, but also deleting the information of the link. i do not want any links in my text, i do not want any text of web address in my document.
    i do not want to disable the links, instead i want all the web addresses out of the text.

    What is stopping you to erase them?

  • How do I write a vi that will save graph data and text data (related to the graph) so the next time I want to view the graph data the text data is included in the read vi?

    I am new at writing vi's and hope you may be able to help. I would like to create a vi that will graph measurements taken from a daq device. I would like to include text data that a user can choose from (example: machine number, test circuit, load cell type) that will stay with the graph so when the graph is viewed at a later time the text data (explaining parts of the graph) will display with the graph data. I have included a vi I am using to capture and display a force value. Any help would be greatly appreicated.
    Attachments:
    force.vi ‏500 KB

    What you want is a DATALOG file:
    When you save a file, use the BUNDLE function to bundle your machine number, test circuit, whatever (include a few spare fields), plus your graph data. Get the graph data from the source, or use a local variable of the graph itself.
    Wire the bundle output to the DATALOG TYPE of a NEW FILE function. (I presume you'll use a FILE DIALOG set to SAVE FILE to choose a file path).
    Write the same bundle output to the DATA input of a WRITE FILE function.
    Use a CLOSE FILE function to (ahem) close the file.
    When you want to read a file, use a FILE DIALOG set to EXISTING FILE (or some other means) to specify what file to read. Wire the same cluster type to the DATALOG TYPE of the FILE DIALOG, so that it will only
    offer files of the correct type.
    When you have a file path chosen, wire the bundle to the DATALOG TYPE input of a FILE OPEN operation.
    Use a FILE READ to read a single cluster - the output of FILE READ will be a cluster of the right type.
    Use a CLOSE FILE function to....
    Out of the FILE READ function, you can UNBUNDLE BY NAME the data and send to the graph and the other fields, or, if you're clever, you can use a cluster on the screen, and not unbundle it. That's harder though, since you probably want the text fields to be controls (inputs) and the graph to be an indicator (output).
    Hope that helps.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • 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.

  • Is there an easier way to see all my texts from one friend?  The harder way is just clicking "see more messages" over and over again on the iPhone.

    Hi Everyone!
    I would like to be able to see (and possibly print out) all the texts that I have exchanged with one of my contacts.  Right now, I only know how to see the older texts by clicking "see more messages" every time I want to go back further in our history. 
    Thanks for reading my issue!
    Lori

    If a password is filled then that can only be done if the password is saved in the password manager.<br />
    If only the name is filled then that can be done by form fill.
    *Form History Control: https://addons.mozilla.org/firefox/addon/form-history-control/

  • When i open facebook and only text shows and all is to the left and when i open hotmail nothing shows on my screen and other webpages have problems also when click at a link all the text comes up also to the left in my screen whats wrong ???

    When i open facebook and only text shows and all is to the left and when i open hotmail nothing shows on my screen and other webpages have problems also when click at a link all the text comes up also to the left in my screen whats wrong ???

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    See also:
    * http://kb.mozillazine.org/Websites_look_wrong
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]
    In Firefox 4 you can use one of these to start in <u>[[Safe mode]]</u>:
    * Help > Restart with Add-ons Disabled
    * Hold down the Shift key while double clicking the Firefox desktop shortcut (Windows)

  • My parent's IPad is SUPER outdated and I'm trying to buy an app for my brother for Christmas. However, the computer that was connected to the IPAD, we no longer have. So is there any way I can update it on my mac without erasing all the photos and videos?

    My parent's IPad is SUPER outdated and I'm trying to buy an app for my brother for Christmas. However, I can't buy the app because it says we need to update the software. The thing is, the computer that was connected to the IPAD, we no longer have. So is there any way I can update it on my mac without erasing all the photos and videos?

    HELPPP ME BEFORE CHRISTMASS MORNING!!

  • Is there a way to find all highlights made in the macbook ibooks library in the case that you cant remember the book in which the highlight was made?

    Is there a way to find all highlights made in the MacBook iBooks library in the case that you cant remember the book in which the highlight was made?

    Some things that might help:
    1. Only the most recently used apps actually occupy memory (used to be the most recent 4, but may have changed in the latest iPhones). After 4 (or so), IOS writes them out of active memory, as it does for even the latest 4 if there's no activity for a long time. So the business of closing all the open apps, apart from the most recent ones doesn't make a difference. Tis article has a good explanation:
    http://www.speirs.org/blog/2012/1/2/misconceptions-about-ios-multitasking.html
    2. There are settings about background app activity that might help:
    - Settings, General, Background App Refresh controls which apps can update their data in the background
    - Settings, Notifications controls which apps can tell you things, which they have to wake up to do.
    - Settings, Privacy, Location Services controls which apps monitor your location - another activity that uses resources
    Hope some of that helps

  • 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.

  • Shutting down my iPhone 4S no longer removes all the apps that have accumulated on the multitasking bar. What happened?

    Maybe I imagined it, but I could have sworn that holding down the home button and sleep button at the same time until the slider icon appears at the top of the screen, and then engaging the slider icon,  completely shuts down your iPhone and also removes all the apps that have accumulated in the multitasking bar.  But, that does not work anymore on my iPhone 4S running iOS 5.0.1 (9A405).  The iPhone shuts down, but the apps in the multitasking bar remain after you turn the phone back on.  Did I imagine this feature in the past, or has something happened that no longer enables this functionality?  Closing all those open apps in the multitasking bar one at a time is a PIA. 

    imanfromsweden wrote:
    Please apple support do you people have a convincing answer for us? Is there a solution? My phone is only 2 years old and was (2 hours ago), in top condition!!
    Please help....
    On belhalf of my fellow volunteers, the answer is, "We'll try our best." 
    My advice is to try not to treat this like it is a paid service provided by compensated professionals.  Ask nicely and one of the nice folks here might take some time out of their weekend to offer advice.

Maybe you are looking for

  • Voice to text is lagging in Messaging and 2 other apps.

    When input times out, "tap to speak" appears and the rest of the dictation appears. frustrating. 2 weeks now. Happens with Google Translate and WeChat as well. Have done a reboot in safe mode, happens there as well. Thanks! Mark

  • How to use swf object

    Hi have been trying to get my head around how to use swf object, I know very little javascript and so am having difficulty in modifying the code to suit my needs.  This is my page which I have used dreamweaver cs3 and have used insert>media>flash and

  • Share SAP NetWeaver Application Server ABAP 7.02 SP6 32-bit Trial Version

    Hi, Have any of you downloaded SAP NetWeaver Application Server ABAP 7.02 SP6 32-bit Trial Version (http://www.sdn.sap.com/irj/scn/downloads?rid=/library/uuid/80db43c2-9ee5-2d10-de8e-8547de363868) successfully?could you share it ? I failed to downloa

  • How to I show a tooltip using a keyboard shortcut?

    Hi, does any one know how to show a tooltip for the currently active item in a web page using the keyboard? I can get tooltips to display using the mouse, but I'd like a keyboard shortcut too. Shift -F1 didn't help, nor Ctrl-F1. Any ideas? == This ha

  • Exported session doesn't sound the same

    I've noticed that what I hear through my Yeti USB microphone is much different (and much better) than a session I export 'master' tracks.  Is there another way to export in Audition CS5.5 that I'm unaware of? Thanks, Mike