Find the answer to your Linux question:
Results 1 to 2 of 2
Is it possible to write a program such that it can capture the data from an X Client to X server and extract only the Text data inside it ?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2013
    Posts
    1

    X Windows Query


    Is it possible to write a program such that it can capture the data from an X Client to X server and extract only the Text data inside it ?

  2. #2
    Just Joined!
    Join Date
    May 2013
    Posts
    37
    The short answer is yes.

    There are programs that exist that will capture text from various X clients depending on what they are. For example if you want the text from a browser window open at some some.site.html you could use lynx to extract the text with:
    Code:
    lynx -dump www.some.site.html > some.site.txt
    or if the site has frames, elinks handles them better:
    Code:
    elinks -dump www.some.site.html > some.site.txt
    Both of these commands create the text file some.site.txt which has only text and can be opened in a text editor. They can extract text from any html file.

    If the window you want the text from is a pdf file then you can use:
    Code:
    pdftotext somefile.pdf
    which will produce a file called somefile.txt which should just have the text of the pdf file.

    I suppose it depends on what format the window is as to how you extract the text.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •