�using a BufferedReader object to capture text from a JTextField?

Please i need some help with this.
I was using the following line to get the data from the keyboard:
BufferedReader en =new BufferedReader(new InputStreamReader(System.in));
But now i changed to get the data from an applet, where the user would type the info i need into a JTextField. How do I create a BufferedReader that contains the string typed by the user?
I know how to capture the event and everything, my problem is : i dont know how to set the value of my variable "en" with the text typed by the user in the JTextField.
Thanks a lot.

You might want to think about your design and figure out if you really need a BufferedReader to get the text from a text box, or whether a BufferedReader was just something you had to do on the way to getting a string from the console.
If you really need a BufferedReader (e.g. because the contents of the text box might be several lines and you need those lines one at a time) thennew BufferedReader(new StringReader(jtf.getText()))

Similar Messages

  • Using browser javascript to copy selected text from a pdf file opened in Air app.

    I have posted this question on reader forum as well, but I think it is more suited here...
    I am trying to create a note-taking application in air. I want to extract selected text from pdf file as a string object or to the clipboard.
    Obviously, all pdfs in my local storage will not be scripted to recieve postMessages and act accordingly, and that is not practical either. So, my problem is, how can I copy the selected text in the pdf file (opened as an object in htmlloader within my Air app) to clipboard or directly in another control by say clicking a button in air application? I suppose, this is possible using javascript, however, I don't know which reader methods are exposed to the wrapper htmlloader control. In short, I want to execute app.execMenuItem("Copy") command through htmlloader javascript. Any alternate solutions are also welcome.
    This is similar to passing inbuilt commands/methods/functions (of adobe reader) to pdf-reader plugin embedded in a webpage via javascript. This is possible in IE where the pdf is rendered as activex object, and hence JSObject interface of pdf document/reader is accessible to the browser javascript. I have also read that this same JSObject is accessible to VB as interface for IAC, so as the Air is Adobe's own product, I was wondering if equivalent of JSObject is accessible to htmlloader control as well.
    Thanks in advance...
    Mits

    Thank you Thom for your reply...
    from
    http://www.adobe.com/devnet/acrobat/javascript.html
    ...Through JavaScript extensions, the viewer application and its plug-ins expose much of their functionality to document authors, form designers, and plug-in developers...
    As it is explicitly mentioned, that the functionality of adobe reader are exposed for plugin development, I thought someone here might have used external javascript to execute some safe methods in adobe reader. The functionality (i.e. external javascript interface-JSObject) is already available for VB programmers to develop IAC. Further, the Acrobat SDK example called "AcroPDFinHML" shows how one can embed a pdf-reader in a html page and execute some safe methods (like gotonextpage(), zooming etc.) in IE as ActiveX plugin. I have checked it myself for adobe reader 9, and it works perfectly, so there is no security issue as such to implement the same for another browser (like in my case, the htmlloader control in flex/air app).
    I intend to create a note taking application in air, where it is very much required that I should be able to copy selected text from various pdf documents, that are open in my app, and subsequently paste/collect/save the collected notes and process them afterwords (offcourse, from the pdfs that allow me copying text). However, it is not happening for me here. As the pdfs are opened through adobe reader plugin, it does not register the copy command executed by my air app. It registers the system level copy command (by keyboard shortcut Ctrl+C), but my air app has no way to execute the system level copy command programmatically. So I am kind of stuck here...
    Thanks again for your reply. Having known what am I intend to accomplish, any other (may be alternative) solutions will be appreciated nonetheless...
    Mits

  • How can I use Automator or AppleScript to get text from a web page and paste it in execl?

    I don't know how to make scripts or complexed automator workflows... that's why I'm asking.
    I'm trying to make a simple app or script to ask me what text to extract from a web page, like name, address and phone number of a web page and paste each one of these data in the righ cell of excel.
    I was thinking to promt a request from automator or an applescript to ask me which text to extract from the page or to look throught the HTML of the page to search for specific html tags, from which extracting text and then importing it, or paste it to the specified execl cell. Name in the name cell, address in the address cell and so on.
    Can somebody help me to make this script?
    If you know an alternative, like a software that already do this or another language to use, please tell.

    Try holding down the alt key as you mark the text to be copied. You can then copy columns to table text.

  • Automatically capturing text from service entry sheet at MIRO

    Dear all,
    I am working on a scenario where invoice posting(MIRO) is to be done against service entry sheet. I want to insert a text at the time of creating service entry sheet and to capture the same automatically in MIRO. Can you pl advise me how can I do that ?
    Reward if useful.
    thanks 
    Amitava

    Hi,
    You can refer to the link below:
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=capturingtextfromserviceentrysheetatMIRO++&adv=false&sortby=cm_rnd_rankvalue
    Its very useful link
    Hope this will help you.
    Regards,
    Sushama

  • Capturing text from an InputFile component

    I am succesfully using an InputFile component and can process the file using fileUploaded(ValueChangeEvent event) in a backing bean.
    Is it possible to grab the contents of the screen field.
    e.g. if I browse and return C:\Java\List.txt to the InputFile box, can I somehow capture the path and filename to a String field?
    Regards
    Jon L.

    you can assign event.getNewValue( ) to a UploadedFile variant :uf
    and then use uf.getFileName( ) ........
    btw:
    can you give me some help about making ValueChangeEvent can work?

  • Merging and saving audio capture + file from disk

    Hi,
    I need to combine an audio file (read from disk) with an audio capture from a microphone and save the combined audio to a file.
    I created processors for both, merged the data sources and created a processor from the merged data source.
    If I use that as an input to a player, it seems to play OK : I hear the combination of the audio file and the microphone over the speakers (albeit with a delay of the microphone input).
    But when I try to save this merged processor's data source (I tried 2 different ways based on samples I found) I get the following exceptions respectively
    writeToFile
    javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.RawBufferMux$RawBufferDataSource@121cc40
         at javax.media.Manager.createDataSink(Manager.java:1894)
         at soundTest.MergeTest4.writeToFile(MergeTest4.java:108)
         at soundTest.MergeTest4.runTest(MergeTest4.java:70)
         at soundTest.MergeTest4.main(MergeTest4.java:207)
    writeToFile2:
    Unable to handle format: LINEAR, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed
    Unable to handle format: LINEAR, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 176400.0 frame rate, FrameSize=32 bits
    Failed to realize: com.sun.media.ProcessEngine@691f36
    Error: Unable to realize com.sun.media.ProcessEngine@691f36
    javax.media.CannotRealizeException
         at javax.media.Manager.blockingCall(Manager.java:2005)
         at javax.media.Manager.createRealizedProcessor(Manager.java:914)
         at soundTest.MergeTest4.saveFile(MergeTest4.java:83)
         at soundTest.MergeTest4.runTest(MergeTest4.java:71)
         at soundTest.MergeTest4.main(MergeTest4.java:208
    Here's the code (apologies for heavy use of static and poor error handling)
    public class MergeTest4 {
           private static final Format AUDIO_FORMAT = new AudioFormat(AudioFormat.LINEAR);
           private static final int TIME_OUT = 2000;
         private static void runTest() throws Exception {
           DataSource ds1 = getCaptureDataSource();
           DataSource ds2 = Manager.createDataSource(new URL("file:///c:/temp/test.wav"));
           Processor processor1 = Manager.createProcessor(ds1);          
           Processor processor2 = Manager.createProcessor(ds2);  
           configureAndStart(processor1);
           configureAndStart(processor2);
           DataSource[] sources = { processor1.getDataOutput(), processor2.getDataOutput()};
           DataSource mergedDS = Manager.createMergingDataSource(sources);
           Processor mergedProcessor = Manager.createProcessor(mergedDS);    
           configureAndStart(mergedProcessor);
            //This works
            Player player = Manager.createRealizedPlayer(mergedProcessor.getDataOutput());
             player.start();          
             //This does not work
             //  writeToFile(mergedProcessor);
             //  writeToFile2(mergedProcessor);
        private static void writeToFile2(Processor processor) throws Exception {
              ProcessorModel outputPM = new ProcessorModel(processor.getDataOutput(),
                    new Format[]{ new AudioFormat(AudioFormat.LINEAR)},
                    new FileTypeDescriptor(FileTypeDescriptor.WAVE)
            MediaLocator dest = new MediaLocator("file://./rec.wav");
            Processor outputProcessor = Manager.createRealizedProcessor(outputPM);
            DataSource newDS = outputProcessor.getDataOutput();
            newDS.connect();
            newDS.start();
            DataSink dataSink = Manager.createDataSink(newDS, dest);
            dataSink.open();
            dataSink.start();
          //  dataSink.addDataSinkListener(this);
            outputProcessor.start();
         private static void writeToFile(Processor processor) throws Exception {
              StateHelper sh = new StateHelper(processor);
              if (!sh.realize(10000)) {
                   System.exit(-1);
               processor.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.WAVE));
               MediaLocator dest = new MediaLocator("file://c:/temp/foo.wav");
               DataSink filewriter = Manager.createDataSink(processor.getDataOutput(), dest);
               filewriter.open();
               StreamWriterControl swc = (StreamWriterControl) processor.getControl("javax.media.control.StreamWriterControl");
               //set limit to 5MB
               if (swc != null) {
                   swc.setStreamSizeLimit(5000000);
               try {
                   filewriter.start();
               } catch (IOException e) {
                   System.exit(-1);
               // Capture for 20 seconds
               sh.playToEndOfMedia(20000);
               sh.close();
               filewriter.close();
         private static DataSource getCaptureDataSource() {
              try {
                   Vector captureDevices = CaptureDeviceManager.getDeviceList(AUDIO_FORMAT);
                    CaptureDeviceInfo audiocaptureDevice=null;
                    if (captureDevices.size() > 0) {
                         audiocaptureDevice = (CaptureDeviceInfo) captureDevices.get(0);
                    } else {
                         System.out.println("Can't find suitable audio capture device.");
                        return null;
                    return Manager.createDataSource(audiocaptureDevice.getLocator());
              } catch (Exception ex) {
                   ex.printStackTrace();
              return null;
         private static void start(Player player) {
              player.start();
              waitForState(player, Processor.Realized);
         private static void configure(Processor p) {
              p.configure();
              waitForState(p, Processor.Configured);
         private static void configureAndStart(Processor p) {
              p.configure();
              waitForState(p, Processor.Configured);
              start(p);
         private static void waitForState(Player player, int state) {
             if (player.getState() == state) {
                 return;
             long startTime = new Date().getTime();
             final Object waitListener = new Object();
             ControllerListener cl = new ControllerListener() {
                 @Override
                 public void controllerUpdate(ControllerEvent ce) {
                     synchronized (waitListener) {
                         waitListener.notifyAll();
             try {
                 player.addControllerListener(cl);
                 synchronized (waitListener) {
                     while (player.getState() != state && new Date().getTime() - startTime < TIME_OUT) {
                         try {
                             waitListener.wait(500);
                         } catch (InterruptedException ex) {
                             ex.printStackTrace();
             } finally {
                 player.removeControllerListener(cl);
         Any idea what needs to be changed for this to work?
    Thanks
    Philippe

    Drew
    Now that you've got as far as doing GUIs, you must learn to read the API. Here/s a link.
    Is it something like: out.textBox.text() ??
    Not quite. In fact, not at all. The syntax implies that out has a member textBox which in turn has a method text. That's pretty far removed from reality, isn't it?
    From the code you posted, you apparently know that out.println(...) takes a String parameter. Now go look up the API and find a method of JTextField that returns a String, that Returns the text contained in this TextComponent.
    ^Hint: it's a method inherited from JTextComponent^
    Get the text from the JTextField and pass it as a parameter to out.println. That's all there is to it.
    luck, db
    Blasted multiposter didn't have the decency to indicate here that the immediate problem was resolved, just went ahead and started a [new thread|http://forum.java.sun.com/thread.jspa?threadID=5282987].
    One for the little black book.
    Edited by: Darryl.Burke

  • Is there a fix to upside down text from EMF images

    The text from an EMF image is being flipped upside down during the conversion from word to PDF when using the acrobat add-in.  I hope you can see from the images.  However, when using the acrobat print drivers, the text from the EMF converts just fine.  Unfortunately, you can't use the auto create bookmarks feature this way.  What is causing the text from EMF files to be flipped upside down?  Is this a bug?  Has this been reported yet?

    That is really strange. It appears you are using OFFICE 2007 or 2010. There are some issues with MS, but this one is weird. Check that you are using the same job settings for both cases. You are using high-quality-print for PDF Maker. It might be worth checking the print with the same job settings. I am not proposing a solution, but some trouble shooting to be done. Also, please indicate the versions of WORD and Acrobat that you are using.
    If you have a way to try a different vector format other than EMF, that might give you some idea of where the problem lies.

  • InDesign CC is bringing in style sheets from Word and other places that I copy type from, like email, Acrobat. In InDesign CS4, whenever I brought in text from outside it assumed the paragraph style applied to the waiting text box. The loss of this functi

    I used to be able to get text from a Word doc (copy it), and then go into my CS4 InDesign file and paste it into a waiting box that had a paragraph style assigned to it and boom, it would take on the assigned paragraph style of that text box. Now it brings in the style from wherever the text came from. If the font looks similar to what was there it can be too hard to tell that it's different. When you are working on a book with 200 pages and copying text from Word docs and dropping it in here and there in InDesign, it causes alot of extra work and problems.
    In fact I have lost alot of security functions I used to have in CS4 in CC2014 in InDesign, Photoshop, Illustrator and Acrobat and it is making me want to go back to CS4 in a hurry.

    I actually FINALLY found the answer!!!! In the preferences area you choose Clipboard Handling and then you choose "Text Only" under When Pasting Text and Tables from Other Applications (see photo).

  • How to obtain text from TextEditBox on panel

    Hi all,
    I would like to ask you, what should I use when I want to get text from TextEditBox. I have observer, which listens for chages(when user hits enter, method Update from Observer is called). The only thing that I dont know is how to get text, that has been placed into text edit box. I know that dialog observer, has method GetTextControlData, but I have Panel...
    Thx

    Hi Ondrej
    You can get text using ITextControlData interface. Like this:
    InterfacePtr<IControlView> iCtrlView(this, UseDefaultIID());
    if(!iCtrlView) break; // put some assert message
    InterfacePtr<ITextControlData> iTextData(iCtrlView, UseDefaultIID());
    if(!iTextData) break; // put some assert message
    PMString theString = iTextData->GetString()
    Regards
    Bartek

  • Using BufferedReader to get Unicode data from a .php site

    Hi,
    Probably a rather mundane question. I'm working on an applet which uses a .php site as a proxy to get at data found in a mySQL database. It's working adequately for text consisting of standard English characters only - the only problem is that every time I read in a file, it starts with the characters ""
    It's not working at all for text using other characters - I get an incomprehensible string of characters in Java when I try that.
    So my assumption is that Java does not understand that my php document is in Unicode, and is trying to read it using a different encoding system. I use unicode charaters elsewhere in this applet and have no problems with them, so I am assumign it must be an I/O error.
    What do I have to do to make Java realize that this is unicode?
    Here's the relevant code as it is now:
    String goTo = "http://[...]/info.php?search=" + toLink(search);
    URL test = new URL(goTo);
    URLConnection testConnection = test.openConnection();
    BufferedReader dis = new BufferedReader(new InputStreamReader(testConnection.getInputStream()));
    String inputLine;
    while ((inputLine = dis.readLine()) != null) {
                    giveout += inputLine;
    dis.close();The String giveout should have all the data from the document in it after this.
    Or do I need to change something about my php, which, as it is now, just displays the data from my database, with no HTML tags whatsoever?

    You probably have a 'byte order marker' ( BOM ) at the beginning of the file. You can use my BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 or you can just discard the BOM bytes from the InputStream before wrapping it in the BufferedReader.
    Hi Sabre im facin the same probem.
    bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
    bufferedReader.readLine() returns a junk character ? at the beginning of the line.
    you have instructed to use your BOMStripperInputStream posted in reply #7 of http://forums.sun.com/thread.jspa?threadID=5310966 but i dotn know how to use it with bufferedReader because i want my method to return only a BufferedReader object.
    can you suggest me how to go about it.
    my code is as below need help.
    public BufferedReader check(){
                     bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream("C:/Documents and Settings/Administrator/Desktop/UTF8RDFiles/Example.txt"),"UTF-8"));
            return bufferedReader; // need to return bufferedReader object only...since some other code needs bufferedReader ...suggest me.
    i will be highly obliged if you paste the refined code.. please need your urgent help on this...
    Regards
    Deepak

  • How to capture Purchase order text from MM02

    Hi Friends ,
    i have a requirement like i have  to capture the purchase order text from MM02
    from one program.
    Pls give helpful code .
    Thanks & Regards
    Jagadeeshwar.Bachu

    hi
    check this code
    Hi,
    declare the paramters like:
    To fetch Long Text lines for READ_TEXT function module
    DATA:BEGIN OF dt_lines OCCURS 0.
    INCLUDE STRUCTURE tline. " Long Text
    DATA:END OF dt_lines.
    Variable declarations for Read_TEXT function module
    DATA : dl_name TYPE thead-tdname, " Object Name
    dl_lan TYPE thead-tdspras. " Language
    Constants
    CONSTANTS:
    Object ID for Long Text of Sales Item Text
    c_best TYPE thead-tdid value 'Z026', ID
    c_object TYPE thead-tdobject . " Object
    Object will be VBBK, and the Object name will be the concatenation of Sales order and Item No(for Item texts) and only Sales order for Header texts.
    Language will be default sy-Langu.
    In the loop of Sales orders call this fun module and use by passing all the above 4 paramters ID,OBJECT,NAME and LANG.
    You double click on that text
    GOTO -> header you will know the all above paramters.
    READ_TEXT
    READ_TEXT provides a text for the application program in the specified work areas.
    The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
    After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
    If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
    Function call:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING CLIENT = SY-MANDT
    OBJECT = ?...
    NAME = ?...
    ID = ?...
    LANGUAGE = ?...
    ARCHIVE_HANDLE = 0
    IMPORTING HEADER =
    TABLES LINES = ?...
    EXCEPTIONS ID =
    LANGUAGE =
    NAME =
    NOT_FOUND =
    OBJECT =
    REFERENCE_CHECK =
    WRONG_ACCESS_TO_ARCHIVE =
    Export parameters:
    CLIENT
    Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
    Reference field: SY-MANDT
    Default value: SY-MANDT
    OBJECT
    Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
    Reference field: THEAD-TDOBJECT
    NAME
    Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
    Reference field: THEAD-TDNAME
    ID
    Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
    Reference field: THEAD-TDID
    LANGUAGE
    Enter the language key of the text module. The system accepts only languages that are defined in table T002.
    Reference field: THEAD-TDSPRAS
    ARCHIVE_HANDLE
    If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
    The value '0' indicates that you do not want to read the text from the archive.
    Reference field: SY-TABIX
    Default value: 0
    Import parameters:
    HEADER
    If the system finds the desired text, it returns the text header in this parameter.
    Structure: THEAD
    Table parameters:
    LINES
    The table contains all text lines that belong to the text read.
    Structure: TLINE
    Exceptions:
    ID
    The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
    LANGUAGE
    The parameter LANGUAGE contains a language key that does not exist in table T002.
    NAME
    The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
    Possible errors:
    The field contains only blanks.
    The field contains the invalid characters ‘*’ or ‘,’.
    OBJECT
    The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
    NOT_FOUND
    The system did not find the specified text module.
    REFERENCE_CHECK
    The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
    WRONG_ACCESS_ TO_ARCHIVE
    The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
    regards
    siva

  • Is it possible to create a Text Variable that uses text from a structure?

    The question is this -
    I have created structure which consists of 4 high-level nodes. Each level one node contains a different number of level 2 nodes. Is it possible to use the text from these nodes in replacement path variables? 
    Example, my structure levels are:
    GS
    SA
    OOI
    COGS
    If a user drills into COGS, I'd like to display the text "COGS" in the header but I have not found a way to capture it. From what I can tell, the variable editor only allows Characteristics and their text/key or user input text. I don't see an option for Structure level/node text.
    Anyone know if this is even possible?
    Thanks!

    HI!,
    I think you should separate programming for AS3 and for FLEX,
    this is beacuse they both use different class packages. If you want
    your classes to be FLEX compatible you need to extend them from
    Flex Objects and not from AS3 Objects.
    In sum, if you want your class to be processed by let's say
    the application object then you need to extend it from
    mx.core.UIObject.
    This is because there are lots of methods that FLEX uses to
    place your class on the screen that are not used by normal AS3
    applications.

  • Why doesn't "include/object/text from file" work?

    I want to include (link) text from other Word documents to a  main  Word document and I use "include/object/text from file" (Word function)
    It works fine when I do so in "H:", but doing exactly the same in the Sharepoint environement result in "nothing" (nothing happens)
    It DOES work if I link from a document saved in Sharepoint to a "H:" - document, but that is of no use since I need all the documents to be stored in Sharepoint.
    Guess it has to do with the set up och Sharepoint.
    Greatful for any tips!

    Hi,
    Did you mean insert a object in the documents?
    Did you open the file with the local application or office web application?
    In the office web application, it doesn’t have the function to insert a object in the browser.
    I had tested with some word files in the library, open the word files with the local application, then insert file using the insert object function.
    It worked without any issue.
    What’s more, I had tested with Office 2010 and Office 2013, they all worked.
    Did the issue occur in other libraries? You can create a new library to check whether it works.
    You can also download a copy for the issued file, then open it in the local machine to check whether it works in the local machine.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Extract Text from pdf using C#

    Hi,
    We are Solution developer using Acrobat,as we have reuirement of extracting text from pdf using C# we have downloaded adobe sdk and installed. We have found only four exmaples in C# and those are used only for viewing pdf in windows application. Can you please guide us how to extract text from pdf using SDK in C#.
    Thanks you for your help.
    Regards
    kiranmai

    Okay so I went ahead and actually added the text extraction functionality to my own C# application, since this was a requested feature by the client anyhow, which originally we were told to bypass if it wasn't "cut and dry", but it wasn't bad so I went ahead and gave the client the text extraction that they wanted. Decided I'd post the source code here for you. This returns the text from the entire document as a string.
           private static string GetText(AcroPDDoc pdDoc)
                AcroPDPage page;
                int pages = pdDoc.GetNumPages();
                string pageText = "";
                for (int i = 0; i < pages; i++)
                    page = (AcroPDPage)pdDoc.AcquirePage(i);
                    object jso, jsNumWords, jsWord;
                    List<string> words = new List<string>();
                    try
                        jso = pdDoc.GetJSObject();
                        if (jso != null)
                            object[] args = new object[] { i };
                            jsNumWords = jso.GetType().InvokeMember("getPageNumWords", BindingFlags.InvokeMethod, null, jso, args, null);
                            int numWords = Int32.Parse(jsNumWords.ToString());
                            for (int j = 0; j <= numWords; j++)
                                object[] argsj = new object[] { i, j, false };
                                jsWord = jso.GetType().InvokeMember("getPageNthWord", BindingFlags.InvokeMethod, null, jso, argsj, null);
                                words.Add((string)jsWord);
                        foreach (string word in words)
                            pageText += word;
                    catch
                return pageText;

  • Capture Text using Terminal

    Hi,
    I use Terminal to Telnet into my routers. I would like to be able to capture the output text from the routers. Does anybody knows how to accomplish this?
    I don't want to use copy and paste.
    Thanks for your help.

    The standard shell redirect '>' will direct output to the specified file. If the filename doesn't exist it's created. If it does exist, it's overwritten. It's up to you to specify a filename that doesn't conflict with an existing file if you want to keep old ones.
    An alternative would be to use '>>' which appends the text to the file. That way you get one file with all the content.
    However, I'm not sure either of these are going to work for you since they won't work with interactive commands such as telnet - all output is directed to the file and you won't see anything in your terminal.
    You can get a little further by using tee which directs the output to both your terminal window and the file:
    telnet your.router.ip | tee /path/to/file.txt
    which will both capture the output to the file and let you see it. However, it won't capture any input - any commands you type will not be written to the file. Not sure if that's enough for you.
    The last option I can think of is Terminal's Save Text As... command which will let you save the current terminal window in a text file, or Save Selected Text As... which will save the current selection to a file. Both of these are post-processed, though and you'll need to remember to do them before you close the window.

Maybe you are looking for

  • FIOS Skipping recordings

    I recently upgraded to the new FIOS QUANTUM and everything was fine until the new fall TV season started. It's missing and/or skipping some of the new recording. The new DVR is 6 recording at a time the max I am using is 3 maybe 4 on some days. But j

  • My old (1st gen) iPad suddenly doesn't start up, it hasn't been used but I have been charging it for 3 hours and still nothing

    since getting the 'new' ipad, my old one hasn't been used. I tried it early today and it does nothing.  It has been on a charge for a few hours now, the apple logo screen blinks occasionally but that is still all it will do?  Is this normal and will

  • Backing up/transfer questions

    im switching to my new macbook air, how do i back up my bookmarks and add them onto the safari on the new mac air AND is there a best way to transfer my whole iphoto library? i understand its a complicated database and want to do it properly thanks

  • Problem connecting through RFC with fully qualified domain name

    I am using the .NET Connector and RFC to call a BAPI I use a fully qualified domain name in the form <DOMAIN>\<HOST> The RFC seems to have problems with this form of address. It produces the following execption in my .NET code. SAP.Connector.RfcCommu

  • To insert  the date and time

    Hi I have Date 12-Feb-2007 in one string and time 12:00 in anotther string. I need to insert both that is date and time in to Date field of my table. What is java part i need to code before make a insert statement? Can anybody help me? Thank you