Is it possible to highlight the output of putty? - putty

I don’t know whether it is possible? Forgive me if it is silly.
I am using the putty. Where I will run scripts and scripts results large set of set of unorganized data. In which i have to search the data.
For instance in the large set of data retrieved i have to highlight or change the color of the font in the sentence which contains the text "ERROR"?

"the large set of data retrieved i have to highlight or change the color of the font"
hgrep (highlight grep) provides such functionality.
http://acme.com/software/hgrep/
using vi
":set hlsearch" highlight search keyword. but, when data is large, you should have enough memory to load whole data file

Related

Issue with Oracle Reports 6i to PDF

everyone.
I am working with Oracle Reports 6i to generate a report that includeds text in the form of paragraphs. Everything looks fine from the Real Time Viewer however when the report is run to generate a PDF, some, of the paragraphs would change from Justified to Filled.
This doesn't happen for every text container. In a full page I will have two paragraphs that are filled instead of justified.
Here is the details.
Each paragraph is within their own container.
The alignment for all containers is set to Justified(Flush)
Paragraphs have the same font type and font size.
I have already try the size of the output but it didn't make a difference. Is there any configuration parameter or any format function I can use to fix this?
Thank you all!!
If some paragraphs are OK and some are not, I'd suggest you to use good, old copy/paste principle:
delete wrong ones
copy correct one
paste it
edit its contents - hopefully, it'll look OK (as all properties the "correct" one had are now "inherited")

Extract text from rectangle on Windows screen without using OCR

Given a rectangle that represents an area on a Windows screen that contains text, what is the best way to extract the text?
I know that it is possible using OCR, but even after significant pre processing, the quality is really poor.
Getting the Window Text using Win32 API does not always work as well.
Assuming that the text was rendered using a font, is it possible to get it from there?
Any directions would be extremely helpful. Thanks!
Given a rectangle that represents an area on window screen, the best way to extract text is indeed OCR. Use a better OCR library like this one from Microsoft.
The reason getting the window text using Win32 API does not work well is because there may be multiple windows in that rectangle. You will have to find out what all windows the rectangle contains and send a message to get the text for each window. It is not impossible but difficult to do and even if you manage to do that, you will run into issues of text alignment, etc. OCR is your best option.
It does seem possible without using OCR, as NirSoft SysExporter can do this:
https://www.nirsoft.net/utils/sysexp.html
This may be suitable for programmatic use as it can be run from a command line:
Starting from version 1.70, you can export the content of Windows
control from command-line, without displaying any user interface.
You may not be able to target it at a specific rectangle on the screen, but maybe the same result could be achieved by first scraping everything followed by some post-processing.
Further basic info:
SysExporter utility allows you to grab the data stored in standard
list-views, tree-views, list boxes, combo boxes, text-boxes, and
WebBrowser/HTML controls from almost any application running on your
system, and export it to text, HTML or XML file.
...
Known Limitations
SysExporter can export data from most combo boxes, list boxes,
tree-view, and list-view controls, but not from all of them. There are
some applications that use these controls to display data, but the
data itself is not actually stored in the control, but in another
location in the computer's memory. In such cases, SysExporter won't be
able to export the data.
Personally I've used it to grab text from what look like label controls.

Simple file legend in Xmgrace

I am using xmgrace to plot several graphs on a shared axed, from a two-column data file like so:
# title "RMSD"
# xaxis label "Time (ns)"
# yaxis label "RMSD (nm)"
#TYPE xy
# subtitle "C-alpha after lsq fit to C-alpha"
1.7125001 0.0005074
1.7225001 0.0635904
1.7325001 0.0747008
1.7425001 0.0707590
1.7525001 0.0821623
1.7625000 0.0842335
1.7725000 0.0929994
1.7825000 0.0938834
1.7925001 0.1014052
1.8025001 0.1107717
1.8125001 0.1106072
1.8225001 0.1032858
1.8325001 0.0967231
1.8425001 0.1072746
So, I call the command to show me all graphs on the GUI
xmgrace 1.xvg rmsd_amber_2.xvg rmsd_3.xvg
Is it possible to automatically use the filenames as the labels for the legend, using an option found within the GUI of xmgrace? So far xmgrace automatically uses different line colors for each data series, but does not show the filename as the data label.
If this is not possible, please suggest me another GUI software for Linux which is able to open xvg files from the terminal for its visualization "on the fly".
Thanks !
Xmgrace does not do what you want
The xmgrace help (shown by calling xmgrace --help at the terminal) shows that there is no command line flag to specify data set legend titles. If that were the case you could probably come up with some bash commands to parse the title from your data files.
But there is another way
As an alternative, you can load a parameters file containing the correct titles. If you save any parameters file from within the xmgrace GUI and load it in a text editor, you will see that almost every aspect of Plot, Graph and Set appearance properties can be controlled.
However, it is not all needed; we can delete almost all of that information and just keep the lines related to our data set legend titles (everything else will just take the default values).
Solution
A minimal parameter file "template.par" might contain just the following four lines:
with g0
s0 legend "title0"
s1 legend "title1"
s2 legend "title2"
where in your case "title1" would be "RMSD".
You can then use xmgrace -param template.par 1.xvg rmsd_amber_2.xvg rmsd_3.xvg to create the plot.
Automating it
So far so good, but you want to create template.par automatically by parsing your chosen bunch of .xvg files. You could probably achieve this in any number of different ways using a bash script or even a bash one-liner.

Color specific characters as they load into a RTB

I am writing a small CNC G-Code editor. I would like to load the code file into a rich text box (or other?) and color highlight the X,Y,Z,Rand F as it loads.
I've tried loading the file and parsing it afterwords by running through a character at a time to determine what it is and then coloring it but this is impossibly slow. some of my G-Code programs run to thousands of lines.
I know it can be done..... but in VB6??
The richText controls can have RTF data "streamed" into it, or you can append text and set the colours as you go.
If it needs to be done "live" then do it when the cursor's line changes and recolour just the previous line.

How can I change the background color of specific characters in a RTF document?

I'm trying to output RTF (Rich Text Format) from a Ruby program - and I'd prefer to just emit RTF directly without using the RTF gem as I'm doing pretty simple stuff.
I would like to highlight specific characters in a DNA sequence alignment and from the docs it seems that I can either use \highlightN ... \highlight0 or \cbN ... \cb1
The problem is that I cannot get \cb to work in either Word:Mac 2008 or Mac TextEdit (\cf works fine so I know it's not a color table issue)
\highlight does work but seemingly only with two of the possible colors (black and red) and \highlight does not use the custom color table.
By creating simple docs in Word with character shading and saving as RTF I can see blocks of ridiculously verbose RTF code that presumably does what I want, but it is so impenetrable that I'm not seeing the wood for the trees.
Part of the problem may well be that Mac Word is just not implementing RTF properly. I don't have a Windows version of Word handy.
Anyone know the right way to shade blocks of text?
Thanks
--Rob
There is a note in the RTF Pocket Guide that says MS Word does not implement the \cb command. It says MS Word uses \chshdng0\chcbpatN (where "N" is the color number that you would use with \cb). The book recommends using something like the following for compatibility with programs that implement \cbN and/or \chshdng0\chcbpatN: {\chshdng0\chcbpat5\cb5 text}.
Note: The copy of the book I have was published in 2003, so it might be a bit out-of-date.
The sequence of RTF commands that seems to be most universally supported by RTF-capable applications is:
\chshdng10000\chcbpatN\chcfpatN\cbN
These commands:
set the shading to 100 percent
set the pattern foreground and background colors to the color from the color table (we're not actually specifying a shading pattern)
set the character background to the color from the color table
Word was the most difficult application to properly render background colors in:
Despite what the latest (1.9.1) RTF spec says, Word 2013 does not resolve \highlightN colors from the \colortbl. Instead, \highlightN maps to a predefined list of colors. It looks like those colors come from the 1.5 version of the RTF spec.
Regarding \cb, the 1.9.1 spec contains this helpful pointer at the end of the section on Color Table:
Note: Windows versions of Word have never supported \cbN, but it can be emulated by the control word sequence \chshdng0\chcbpatN.
This is almost a useful suggestion, except that if you read the documentation for \chshdngN:
Character shading. The N argument is a value representing the shading of the text in hundredths of a percent.
So, 0 turns out to not be a very useful value; 100 / 0.01 gives us the 10000 we used in the sequence above.
Use WordPad to create RTF documents, not Word. WordPad creates much simpler documents, i.e. approaching human-readable.
I use WordPad every time I need to display formatted text in a WinForms application, and need something that the RichTextBox control can handle being assigned to its Rtf parameter.

Resources