Script to process a list of items and uncomment lines with that item in a second file
Hello,
I have a src code file where I need to uncomment many lines.
The lines I need to uncomment look like,
The comment is the "C" in the first column. This needs to be deleted so that there are 6 spaces preceding "CALL". The key on this line is 'Gmax'. This lets me know that the line needs to be uncommented.
I have a list of such keys
Each key (including the single quotes) will occur only once in the src file being processed. I need to process the list file to look in the src file and uncomment the proper lines. There are about 300 keys in the list file.
This is what I tried,
This simply reads the list file and one at a time looks for the items in the file to modify. The awk code looks for the presence of the key on each line (including the single quotes) and if found prints the substring skipping the first character. When the key is not found on the line, the line is printed unmodified. After the key is processed, the akw modified file is renamed to be the file awk is working on for the next loop.
This works as far as I can tell. I am writing an entire copy of the modified file for each key in the list file, so this is not very efficient. The file renaming at the end of the loop is a bit kludgy as well. This only takes about 7 seconds to run, so maybe I am being picky and should just let it be but I thought I would ask if there were other suggestions.
I have a dropdown menu built in perl tk (I am using active state perl). I want to select a value from the dropdown menu and I want to be able to perform some other actions depending upon what value is selected. I have all the graphical part made but I dont know how to get the selected value. Any... (0 Replies)
Requirement is:
1. comment and uncomment the line with Shell
Script: /opt/admin/fastpg/bin/fastpg.exe -c -=NET (using fastpg.exe as a search option)
2. display = "Commented" (when its commented) and display = "Uncommented" (when its uncommented)
Its urgent, please let me asap!!!
Thanks in... (2 Replies)
Hi,
I've a list in the following format:
Empdept filedetails buildingNo Area
AAA 444 2 juy
AAA 544 2 kui
AAA 567 4 poi
AAA 734 5 oiu
AAA 444 ... (2 Replies)
I have a combo.cgi here. this is linux environment
What i am going to do is this combobox will list down all the flatfile name in this /u/test/cgi-bin/List directory.
after that, i wanted it to open the flatfile and display the content of the flatfile into another listbox or textarea in this page... (0 Replies)
Hi,
I have the following lines that I would like to see in an array for easy comparisons and printing:
Example 1:
field1,field2,field3,field4,field5
value1,value2,value3,value4,value5Example 2:
field1,field3,field4,field2,field5,field6,field7... (7 Replies)
Hi All,
Need a small help in writing a shell script which can delete a few lines from a file which is currently being used by another process.
File gets appended using tee -a command due to which its size is getting increased.
Contents like :
25/09/2012 05:18 Run ID:56579677-1
My... (3 Replies)
cd path
line1
line2
line3
line4
line5
Lets say thats the sample script...So say if i have to comment the above script, which would be the better way so that whenever i want, i cud comment or uncomment the same.
Thanks (1 Reply)
I have one master file "File1" with all such info in it. I need to grep each object under each list from another file "File2". Can anyone help me with a script for this.
File 1
------
List 1
Object 1
Object 2
List 2
Object 3
Object 1
List 3
Object 2
... (5 Replies)
Hello,
I have some tab delimited text data,
file: final_temp1
aname val
NAME;r'(1,) 3.28584
r'(2,)<tab>
NAME;r'(3,) 6.13003
NAME;r'(4,) 4.18037
r'(5,)<tab>
You can see that the data is incomplete in some cases. There is a trailing tab after the first column for each incomplete row. I... (2 Replies)
Hello,
I need to collect some statistical results from a series of files that are being generated by other software. The files are tab delimited. There are 4 different sets of statistics in each file where there is a line indicating what the statistic set is, followed by 5 lines of values. It... (8 Replies)
Discussion started by: LMHmedchem
8 Replies
LEARN ABOUT DEBIAN
xtermcontrol
XTERMCONTROL(1) User Commands XTERMCONTROL(1)NAME
xtermcontrol - dynamic control of XFree86 xterm properties.
SYNOPSIS
xtermcontrol [OPTIONS]...
DESCRIPTION
xtermcontrol makes it easy to change colors, title, font and geometry of a running XFree86 xterm(1), as well as to report the current set-
tings of the aforementioned properties.
Window manipulations de-/iconify, raise/lower, maximize/restore and reset are also supported.
To complete the feature set; xtermcontrol lets advanced users issue any xterm control sequence of their choosing.
OPTIONS --fg=COLOR
Set foreground color (see also COLOR NAMES).
--bg=COLOR
Set background color.
--colorN=COLOR
Set N'th [0-15] color.
--highlight=COLOR
Set highlight color.
--cursor=COLOR
Set cursor color.
--mouse-fg=COLOR
Set mouse pointer foreground color.
--mouse-bg=COLOR
Set mouse pointer background color.
--font=FONT
Set font name (see also FONT NAMES). Alternatively it is possible to specify a fontmenu index as '#[0-6]' or navigate the fontmenu
by relative sizes as '#+N' or '#-N', where N is an optional integer.
--title=STRING
Set window title. Note that mechanisms like the bash(1) PROMPT_COMMAND may overwrite the title.
--geometry=WIDTHxHEIGHT+XOFF+YOFF
Set size and/or position. Through its control sequences the xterm only recognize positive XOFF and YOFF offsets, which are pixels
relative to the upper left hand corner of the display. xtermcontrol is therefore unable to handle negative offsets as described in
the X(7x) GEOMETRY SPECIFICATIONS and therefore truncates negative values to zero.
--get-fg
Report foreground color.
--get-bg
Report background color.
--get-colorN
Report N'th [0-15] color.
--get-highlight
Report highlight color.
--get-cursor
Report cursor color.
--get-mouse-fg
Report mouse pointer foreground color.
--get-mouse-bg
Report mouse pointer background color.
--get-font
Report font.
--get-title
Report window title.
--get-geometry
Report size and position. The size of the text area is reported in characters and the position is reported in pixels relative to the
upper left hand corner of the display.
--maximize
Maximize window.
--restore
Restore maximized window.
--iconify
Iconify window.
--de-iconify
De-iconify window.
--raise
Raise window.
--lower
Lower window.
--reset
Full reset.
--raw=CTLSEQS
Issue raw control sequence (see also XTERM CONTROL SEQUENCES).
--file=FILE
Force xtermcontrol to read configurations (see also CONFIGURATION) from FILE instead of the standard personal initialization file
~/.xtermcontrol.
--force, -f
Skip TERM environment variable check.
--verbose, -v
Print verbose reports.
--help, -h
Print help message and exit.
--version
Print the version number and exit.
CONFIGURATION
xtermcontrol reads a default, ~/.xtermcontrol, or a user specified configuration file on startup. Each line in the file is either a com-
ment or contains an attribute. Attributes consist of a keyword and an associated value:
keyword = value # comment
The valid keyword/value combinations are:
foreground="COLOR"
background="COLOR"
highlight="COLOR"
cursor="COLOR"
mouse-foreground="COLOR"
mouse-background="COLOR"
geometry="WIDTHxHEIGHT+XOFF+YOFF"
font="FONT"
color0="COLOR"
color1="COLOR"
color2="COLOR"
color3="COLOR"
color4="COLOR"
color5="COLOR"
color6="COLOR"
color7="COLOR"
color8="COLOR"
color9="COLOR"
color10="COLOR"
color11="COLOR"
color12="COLOR"
color13="COLOR"
color14="COLOR"
color15="COLOR"
Whitespace is ignored in attributes unless within a quoted value. The character '#' is taken to begin a comment. Each '#' and all remaining
characters on that line is ignored.
FONT NAMES
xtermcontrol accepts any X(7x) FONT NAMES. Font names like '-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1' are very cumber-
some to write, so it is convenient to make use of aliases, e.g. 'fixed' or '8x13', if present in fonts.alias files of the font directo-
ries.
COLOR NAMES
xtermcontrol accepts any X(7x) COLOR NAMES. Basically this means that colors are specified by name or rgb value, e.g. 'blue',
'rgb:0000/0000/FFFF' or '#00F'. Colors are typically reported by the xterm in a device-dependent numerical form, e.g. 'rgb:0000/0000/FFFF'.
Note that old syntax rgb values should always be quoted to avoid '#' being interpreted as the beginning of a comment by the shell (see also
FILES).
XTERM CONTROL SEQUENCES
The secret behind xtermcontrol is xterm control sequences. All the possible (there are a plethora of them) control sequences are documented
in ctlseqs.txt, found in the xterm(1) distribution (see also FILES).
TROUBLESHOOTING
If read/write permissions on the tty's are changed so that special group membership is required to be able to write to the pseudo terminal,
the easiest workaround is to install xtermcontrol setuid root.
Xterm(1) has three resources, allowWindowOps, allowTitleOps, and allowFontOps, that enables or disables special operations which xtermcon-
trol relies on. If any of these resources are set (or defaults) to 'false' xtermcontrol may hang. The resources corresponds to xtermcon-
trol options as:
allowWindowOps:
--raise
--lower
--restore
--maximize
--iconify
--de-iconify
--get-title
--geometry
--get-geometry
allowTitleOps:
--title
allowFontOps:
--font
--get-font
All three resources can usually be enabled for the current xterm session via a menu; ctrl+rightclick and look for menu item names like
'Allow Window Ops'. To set these resource values persistently you can add the following to either your local ~/.Xdefaults file, or to a
system-wide resource file like /etc/X11/app-defaults/XTerm:
*VT100.allowWindowOps: true
*VT100.allowTitleOps: true
*VT100.allowFontOps: true
FILES
<XRoot>/X11/rgb.txt
Default rgb color name file location.
ctlseqs.txt
Xterm control sequences documentation. Distributed with xterm from http://dickey.his.com/xterm/
SEE ALSO xterm(1), X(7x)COPYRIGHT
Copyright (C) 2002-2009 Jess Thrysoee <jess@thrysoee.dk>
xtermcontrol 2.10 October 17, 2009 XTERMCONTROL(1)