04-17-2011
Quote:
Originally Posted by
bartus11
Numeral characters class in Perl is \d, so I guess you want this: (\w+) (\d+)
Tomorrow I'll take a look at those .doc files.
I edited the post above and have changed most of the script to perl. I guessed and used
(\w+) (\n+) and that seemed to work. I also added an excape
(\w+)\ (\d+) since I wanted to match word | space | number, but maybe that's implicit. The only thing I can't manage is the UnUg tag where there is a space between the int and the >. I am also not sure what to do with the tags with multiple args, so those are still in awk.
Thanks very much for all your assistance.
LMHmedchem
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to know the way. I have got parsing down some nodes. But I was unable to get the child node perfectly. If you have code please send it. It will be very useful for me. (0 Replies)
Discussion started by: girigopal
0 Replies
2. Shell Programming and Scripting
Hi, I want to get data from Xml file by using sed or awk command. I want to get the following result :
mon titre 1;Createur1;Dossier1
mon titre 1;Createur1;Dossier1
and save it in cvs file (fichier.cvs).
FROM this Xml file (test.xml):
<playlist version="1">
<trackList>
<track>... (1 Reply)
Discussion started by: yeclota
1 Replies
3. Shell Programming and Scripting
hello,
new to this forum. but i have a requirement to extract the value from multiple xml node and print out the values to new file with comma seperated. would like to know how this would be done using either sed/perl or some unix script. an example would be tremendous...
sample input file:... (2 Replies)
Discussion started by: davidsouk
2 Replies
4. Shell Programming and Scripting
Hello everyone,
Firstly i do not require alot of help.. i am right at the end of finishing my scipt but cannot find a solution to the last part.
What i need to do is, prompt the user for a file to work with, which i have done.
promt the user for an output file - which is done.
#!/bin/bash... (14 Replies)
Discussion started by: hugh86
14 Replies
5. Shell Programming and Scripting
I hopefully have a simple request - I need to process multiple files reformatting the output based on tags at the beginning of each line. So the data for the new 3 lines of the output file are in the HDR line and then the details are in the DTL tagged lines.
for ifile in $indir
do
echo... (1 Reply)
Discussion started by: jason_v_brown
1 Replies
6. Shell Programming and Scripting
I have a Unix file with 200,000 records, and need to remove all records from the file that have the character ‘I' in position 68 (68 bytes from the left). I have searched for similar problems and it appears that it would be possible with sed, awk or perl but I do not know enough about any of these... (7 Replies)
Discussion started by: joddo
7 Replies
7. Shell Programming and Scripting
Hi All,
I need help from any of you.Would be so thankful for your help.
I/P
DDDD,1045,161,1557,429,1694,800,1911,1113,2460,1457,2917>
1609,3113,1869,3317,2732,3701,3727,4132,5857,5107>
9004,6496
DDDD,1125,157,1558,429,1694,800,1911,1117,2432,1444,2906>... (2 Replies)
Discussion started by: Indra2011
2 Replies
8. Shell Programming and Scripting
Hello,
I have a requirement to extract the value from multiple xml node and print out the values to new file to compare.
Would be done using either awk/perl or some unix script.
For example sample input file:
.....
.....
<factories xmi:type="resources.jdbc:DataSource"... (2 Replies)
Discussion started by: slbmind
2 Replies
9. Shell Programming and Scripting
Hi Everyone,
I'm new here and I was checking this old post:
/shell-programming-and-scripting/180669-splitting-file-into-several-smaller-files-using-perl.html
(cannot paste link because of lack of points)
I need to do something like this but understand very little of perl.
I also check... (4 Replies)
Discussion started by: mcosta
4 Replies
10. Shell Programming and Scripting
Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file:
</member>
<member>
<name>TransactionID</name>
<value><string>123456789123456</string></value>
</member>
<member>
<name>Number</name>
... (9 Replies)
Discussion started by: cozzin
9 Replies
LEARN ABOUT SUSE
tk::bindtags
bindtags(3) User Contributed Perl Documentation bindtags(3)
NAME
Tk::bindtags - Determine which bindings apply to a window, and order of evaluation
SYNOPSIS
$widget->bindtags([tagList]);
@tags = $widget->bindtags;
DESCRIPTION
When a binding is created with the bind command, it is associated either with a particular window such as $widget, a class name such as
Tk::Button, the keyword all, or any other string. All of these forms are called binding tags. Each window has a list of binding tags that
determine how events are processed for the window. When an event occurs in a window, it is applied to each of the window's tags in order:
for each tag, the most specific binding that matches the given tag and event is executed. See the Tk::bind documentation for more
information on the matching process.
By default, each window has four binding tags consisting of the the window's class name, name of the window, the name of the window's
nearest toplevel ancestor, and all, in that order. Toplevel windows have only three tags by default, since the toplevel name is the same
as that of the window.
Note that this order is different from order used by Tcl/Tk. Tcl/Tk has the window ahead of the class name in the binding order. This is
because Tcl is procedural rather than object oriented and the normal way for Tcl/Tk applications to override class bindings is with an
instance binding. However, with perl/Tk the normal way to override a class binding is to derive a class. The perl/Tk order causes instance
bindings to execute after the class binding, and so instance bind callbacks can make use of state changes (e.g. changes to the selection)
than the class bindings have made.
The bindtags command allows the binding tags for a window to be read and modified.
If $widget->bindtags is invoked without an argument, then the current set of binding tags for $widget is returned as a list. If the
tagList argument is specified to bindtags, then it must be a reference to and array; the tags for $widget are changed to the elements of
the array. (A reference to an anonymous array can be created by enclosin the elements in [ ].) The elements of tagList may be arbitrary
strings or widget objects, if no window exists for an object at the time an event is processed, then the tag is ignored for that event.
The order of the elements in tagList determines the order in which binding callbacks are executed in response to events. For example, the
command
$b->bindtags([$b,ref($b),$b->toplevel,'all'])
applies the Tcl/Tk binding order which binding callbacks will be evaluated for a button (say) $b so that $b's instance bindings are invoked
first, following by bindings for $b's class, followed by bindings for $b's toplevel, followed by 'all' bindings.
If tagList is an empty list i.e. [], then the binding tags for $widget are returned to the perl/Tk default state described above.
The bindtags command may be used to introduce arbitrary additional binding tags for a window, or to remove standard tags. For example, the
command
$b->bindtags(['TrickyButton',$b->toplevel,'all'])
replaces the (say) Tk::Button tag for $b with TrickyButton. This means that the default widget bindings for buttons, which are associated
with the Tk::Button tag, will no longer apply to $b, but any bindings associated with TrickyButton (perhaps some new button behavior) will
apply.
BUGS
The current mapping of the 'native' Tk behaviour of this method i.e. returning a list but only accepting a reference to an array is counter
intuitive. The perl/Tk interface may be tidied up, returning a list is sensible so, most likely fix will be to allow a list to be passed
to /fIset/fR the bindtags.
SEE ALSO
Tk::bind Tk::callbacks
KEYWORDS
binding, event, tag
perl v5.12.1 2007-05-05 bindtags(3)