10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a text file which looks like this
a.txt
A,12,Apple,Red
B,33,Banana,Yellow
C,66,Sky,Blue
I need to search for a particular field(s) in particular column(s) and for that matching line need to replace the nth column.
Sample scenario 1:
Search for 66 in second field and Sky in... (5 Replies)
Discussion started by: wahi80
5 Replies
2. Shell Programming and Scripting
$ cat /cygdrive/d/Final2.txt
1,A ,Completed, 07.03_23.01 ,Jun 30 20:00
2,BBB,Pending,,
3,CCCCC,Pending,,
4,DDDDD,Pending,,
5,E,Pending,,
6,FFFF,Pending,,
7,G,Pending,,
In the above file 4th field is date which is in MM.DD_HH.MIN format and I need to convert it to as it is there in 5th... (1 Reply)
Discussion started by: Amit Joshi
1 Replies
3. Shell Programming and Scripting
Hi All,
I am very new to shell scripting and tried to search this in the forum but no luck.
Requirment:
I have an input file which is comma separated. I need to replace the value in 4th column with another value. This has to happen for all the lines in the file.
Sample data:
Input... (2 Replies)
Discussion started by: arunkumarsd
2 Replies
4. Shell Programming and Scripting
Using Awk, how can I achieve the following?
I have set of record numbers, for which, I have to replace the nth field with some values, say spaces.
Eg:
Set of Records : 4,9,10,55,89,etc
I have to change the 8th field of all the above set of records to spaces (10 spaces).
Its a delimited... (1 Reply)
Discussion started by: deepakwins
1 Replies
5. UNIX for Dummies Questions & Answers
Hi all,
I have a TAB separated file like this:
sample.rpt:
54 67 common/bin/my/home {{bla bla bla}} {bla bla} Replace Me
89 75 bad/rainy/day/out {{ some bla} } {some bla} Dontreplace Me
......
......
I wish to do a regexp match on the 3rd... (2 Replies)
Discussion started by: newboy
2 Replies
6. Shell Programming and Scripting
Hi,
I have a date/time field in my file. I have to search in all the records and append a timestamp to it, if the timestamp is missing in that field. Is there a possible awk solution for this?
Field date format
File1
====
1|vamu|payer|2007-12-02 02:01:30|bcbs|... (5 Replies)
Discussion started by: machomaddy
5 Replies
7. Shell Programming and Scripting
Hi,
In my file (which is "," delimited and text qualifier is "), I have to extract a particualr field.
file1:
1,"aa,b",4
expected is the 2nd field:
aa,b
I tried the basic cut -d "," -f 2 file 1, this gave me
aa alone instead aa,b.
A small hint ot help on this will be very... (5 Replies)
Discussion started by: machomaddy
5 Replies
8. Shell Programming and Scripting
Hi All,
I wanted to find 200th field value in delimiter file using awk.?
awk '{print $200}' inputfile
I am getting error message :-
awk: The field 200 must be in the range 0 to 199.
The source line number is 1.
The error context is
{print >>> $200 <<< }
using... (4 Replies)
Discussion started by: Jairaj
4 Replies
9. Shell Programming and Scripting
Hi,
I am looking for any script which can do the following.
have to read a pattern from fileA and copy it to fileB.
fileA:
...
...
Header
...
...
..p1
...
...
fileB:
....
....
Header (3 Replies)
Discussion started by: anilvk
3 Replies
10. Shell Programming and Scripting
HI all
I have a problem, I need to replace a field in a file, but only in the lines that have some pattern, example:
100099C01101C00000000059394200701CREoperadora_TX
100099C01201C00000000000099786137OPERADORA_TX2
in the example above I need to change the first field from 1 to 2 only if... (3 Replies)
Discussion started by: sergiioo
3 Replies
XmSetProtocolHooks(3X) XmSetProtocolHooks(3X)
NAME
XmSetProtocolHooks - A VendorShell function that allows pre and post actions to be executed when a protocol message is received from MWM
SYNOPSIS
#include <Xm/Xm.h> #include <Xm/Protocols.h>
void XmSetProtocolHooks (shell, property, protocol, prehook, pre_closure, posthook, post_closure)
Widget shell;
Atom property;
Atom protocol;
XtCallbackProc prehook;
XtPointer pre_closure;
XtCallbackProc posthook;
XtPointer post_closure;
void XmSetWMProtocolHooks (shell, protocol, prehook, pre_closure, posthook, post_closure)
Widget shell;
Atom protocol;
XtCallbackProc prehook;
XtPointer pre_closure;
XtCallbackProc posthook;
XtPointer post_closure;
DESCRIPTION
XmSetProtocolHooks is used by shells that want to have pre and post actions executed when a protocol message is received from MWM. Since
there is no guaranteed ordering in execution of event handlers or callback lists, this allows the shell to control the flow while leaving
the protocol manager structures opaque.
XmSetWMProtocolHooks is a convenience interface. It calls XmSetProtocolHooks with the property value set to the atom returned by interning
WM_PROTOCOLS. Specifies the widget with which the protocol property is associated Specifies the protocol property Specifies the protocol
atom (or an int cast to Atom) Specifies the procedure to call before calling entries on the client callback-list Specifies the client data
to be passed to the prehook when it is invoked Specifies the procedure to call after calling entries on the client callback-list Specifies
the client data to be passed to the posthook when it is invoked
For a complete definition of VendorShell and its associated resources, see VendorShell(3X).
SEE ALSO
VendorShell(3X), XmInternAtom(3X), XmSetWMProtocolHooks(3X)
XmSetProtocolHooks(3X)