How to scrape rxvt screen for text ?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

How to scrape rxvt screen for text ?

#1 Post by sunburnt »

I think 8-bit also asked this Q...
How to get rxvt`s screen output while it`s running a CLI app.

Need last line of the rxvt screen output while it`s running vobcopy.
Sometimes the movie size is stated wrong ( how do they do that ? ).
But once vobcopy is running the movie size is stated correctly.
This will help automate the ripping process.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

I don't have a dvd handy but
vobcopy -I <something.vob> |tail -1
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#3 Post by sunburnt »

Thanks technosaurus, I`ll give it a try and let you know...

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#4 Post by Flash »

The way to copy and paste in rxvt is known only to the guy who wrote rxvt and a few of his closest friends. You'd think it would be in rxvt's help menu, but nooooo. :evil:

I seem to remember once highlighting some text in rxvt and using something like ctrl-s to copy and ctrl-v to paste.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#5 Post by technosaurus »

middle click to cut/paste in rxvt, but it sounded like sunburnt needed the text in a script... perhaps I misinterpreted
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#6 Post by Flash »

I copied this from a rxvt window, then pasted it into the forum compose window by simultaneously clicking the left- and right- click buttons after highlighting the text in rxvt, and clicking them again in the empty compose window:

Code: Select all

# growisofs -M /dev/dvd -D -R -l -new-dir-mode 0755 -graft-points dotPets=/tmp/dotPets

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#7 Post by sunburnt »

Flash; You use the middle button ( scroll button ) to paste in rxvt and xterm.
BUT... The copy text HAS to be highlighted... Not copied...
You can paste into rxvt, from rxvt, and within rxvt this way.
Why it behaves this why is beyond comprehension.

technosaurus is correct though...
I need a script to be able to read the text being displayed in rxvt,
so in the usual Linux fashion redirecting to a file is probably needed.
technosaurus; I tried these: ( "-I" gives info )

Code: Select all

vobcopy -f -o /mnt/sda6/v/bicentennialMan.vob |tail -1 > /tmp/vobTEST

rxvt -e vobcopy -f -o /mnt/sda6/v/bicentennialMan.vob |tail -1 > /tmp/vobTEST

rxvt -e vobcopy -f -o /mnt/sda6/v/bicentennialMan.vob |tail -1 2> /tmp/vobTEST

rxvt -e vobcopy -f -o /mnt/sda6/v/bicentennialMan.vob > /tmp/vobTEST
rxvt runs vobcopy and creates the file: /tmp/vobTEST but the file is empty.
I tried it without "|tail -1" just to simplify it and it did the same thing.

I don`t recall this ever being done, there`s lots of uses for it though...
Last edited by sunburnt on Thu 11 Feb 2010, 19:39, edited 4 times in total.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#8 Post by Flash »

sunburnt wrote:Flash; You use the middle button ( scroll button ) to paste in rxvt and xterm.
But I don't have a middle button. :) (Simultaneously clicking both the left and right mouse buttons does the same thing as clicking a middle button, if you have one.)

Anyway, I finally understood what you meant. As usual, I was way off target. :lol:

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#9 Post by technosaurus »

if you could post the output you want to get at, it would be easier to help
just do

vobcopy ... >output 2>errors

There is an example in woo-ff for grepping the resolution using ffmpeg
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply