Sponsored Content
Top Forums Shell Programming and Scripting How to grab data from xml block? Post 302642983 by itkamaraj on Friday 18th of May 2012 09:24:05 AM
Old 05-18-2012
Code:
$ cat a.txt
<topLevel numberBlock="BLOCK1">
        <item="content1" title="Content 1">
            <RefPath="path/to/file1.txt"/>
        </item>
        <item="content2" title="Content 2" >
            <RefPath="path/to/file2.txt" />
        </item>
    </topLevel>
$ awk -F\" '/BLOCK1/{a=1} /<\/toplevel>/{a=0} a && /item/ {item=$2} a && item  && /RefPath/ {path=$2} a && item && path {print item,path;item=path=0}' a.txt
content1 path/to/file1.txt
content2 path/to/file2.txt

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

search and grab data from a huge file

folks, In my working directory, there a multiple large files which only contain one line in the file. The line is too long to use "grep", so any help? For example, if I want to find if these files contain a string like "93849", what command I should use? Also, there is oder_id number... (1 Reply)
Discussion started by: ting123
1 Replies

2. Shell Programming and Scripting

How to grab data between 2 strings ?

Hi All, I have a text file below. How do i grab all the data between "05T00NPQSMR1" and "****" using awk ? Pls note that the text lines may not be fixed and text content is dynamic. Pls help. Thanks Below is my code where $LOT_SUFFIX is my shell variable. awk '/'"$LOT_SUFFIX"'/,/blah/'... (16 Replies)
Discussion started by: Raynon
16 Replies

3. UNIX for Dummies Questions & Answers

grab the data from the unix window

Hi, How could i grab a set of data (eg:file execution start & stop time stamp f) from unix? (1 Reply)
Discussion started by: siriv
1 Replies

4. Shell Programming and Scripting

Using Python to grab data from a website

Hello Everyone, I'm trying to write a python script that will go to the following website and grab all the data on the page. The page refreshes regularly and the number of flights is different. Untitled Document What I wanted to do was grab all the data (except for top three row containing... (5 Replies)
Discussion started by: jl487
5 Replies

5. Shell Programming and Scripting

Grab the data

Hello Honourable Members, I stuck into one issue, my server is migrating from UNIX to linux and ptree command does not work there. I was working with pstree command in linux and need some help regarding the same. suppose i have one line for example: ram (121)--- sita... (3 Replies)
Discussion started by: singhabm
3 Replies

6. Shell Programming and Scripting

Grab 2 pieces of data within a file

I am a newbie and what I have is a captured file of content. I want to be able to grab 2 pieces of data, multiple times and print them to the screen. DataFile owner: locke user: fun data size: 60 location: Anaheim owner: david user: work data size: 80 location: Orange my script... (2 Replies)
Discussion started by: greglocke
2 Replies

7. Shell Programming and Scripting

Grab data within a table in a long log file.

in my file which is a rather long log file it contains many text and tables and there is one table with 15 columns and I am interested to read in the value in column6 and its corresponding value in column2. Trouble is I do not know how to script it as the line number various between different log... (8 Replies)
Discussion started by: piynik
8 Replies

8. Shell Programming and Scripting

How to grab a block of data in a file with repeating pattern?

I need to send email to receipient in each block of data in a file which has the sender address under TO and just send that block of data where it ends as COMPANY. I tried to work this out by getting line numbers of the string HELLO but unable to grab the next block of data to send the next... (5 Replies)
Discussion started by: loggedout
5 Replies

9. Shell Programming and Scripting

awk to grab data in range then search for pattern

im using the following code to grab data, but after the data in the range im specifying has been grabbed, i want to count how many instances of a particular pattern is found? awk 'BEGIN{count=0} /parmlib.*RSP/,/seqfiles.*SSD/ {print; count++ } /103 error in ata file/ END { print count }'... (3 Replies)
Discussion started by: SkySmart
3 Replies
tooltip(3tk)							Tooltip management						      tooltip(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
tooltip - Tooltip management SYNOPSIS
package require Tcl 8.4 package require msgcat 1.3 package require tooltip ?1.4.4? ::tooltip::tooltip command ?options? ::tooltip::tooltip pathName ?option arg? message _________________________________________________________________ DESCRIPTION
This package provides tooltips, small text messages that can be displayed when the mouse hovers over a widget, menu item, canvas item, listbox item or text widget tag. COMMANDS
::tooltip::tooltip command ?options? Manage the tooltip package using the following subcommands. clear index Prevents the specified widgets from showing tooltips. pattern is a glob pattern and defaults to matching all widgets. delay ?millisecs? Query or set the hover delay. This is the interval that the pointer must remain over the widget before the tooltip is dis- played. The delay is specified in milliseconds and must be greater than 50ms. With no argument the current delay is returned. fade ?boolean? Enable or disable fading of the tooltip. The is enabled by default on Win32 and Aqua. The tooltip will fade away on Leave events instead disappearing. disable off Disable all tooltips enable on Enables tooltips for defined widgets. ::tooltip::tooltip pathName ?option arg? message This command arranges for widget pathName to display a tooltip with message message. The tooltip uses a late-binding msgcat call on the passed in message to allow for on-the-fly language changes in an application. If the widget specified is a menu, canvas or text widget then additional options are used to tie the tooltip to specific menu entries, canvas items or text tags. -index index This option is used to set a tooltip on a menu item. The index may be either the entry index or the entry label. The widget must be a menu widget but the entries do not have to exists when the tooltip is set. -items name This option is used to set a tooltip for canvas widget or listbox items. For the canvas widget, the item must already be present in the canvas widget and will be found with a find withtag lookup. For listbox widgets the item(s) may be created later but the programmer is responsible for managing the link between the listbox item index and the corresponding tooltip. If the listbox items are re-ordered, the tooltips will need amending. If the widget is not a canvas or listbox then an error is raised. -tag name The -tag option can be used to set a tooltip for a text widget tag. The tag should already be present when this command is called or an error will be returned. The widget must also be a text widget. EXAMPLE
# Demonstrate widget tooltip package require tooltip pack [label .l -text "label"] tooltip::tooltip .l "This is a label widget" # Demonstrate menu tooltip package require tooltip . configure -menu [menu .menu] .menu add cascade -label Test -menu [menu .menu.test -tearoff 0] .menu.test add command -label Tooltip tooltip::tooltip .menu.test -index 0 "This is a menu tooltip" # Demonstrate canvas item tooltip package require tooltip pack [canvas .c] set item [.c create rectangle 10 10 80 80] tooltip::tooltip .c -item $item "Canvas item tooltip" # Demonstrate listbox item tooltip package require tooltip pack [listbox .lb] .lb insert 0 "item one" tooltip::tooltip .lb -item 0 "Listbox item tooltip" # Demonstrate text tag tooltip package require tooltip pack [text .txt] .txt tag configure TIP-1 -underline 1 tooltip::tooltip .txt -tag TIP-1 "tooltip one text" .txt insert end "An example of a " {} "tooltip" TIP-1 " tag. " {} KEYWORDS
balloon, help, hover, tooltip COPYRIGHT
Copyright (c) 1996-2008, Jeffrey Hobbs tooltip 1.4.4 tooltip(3tk)
All times are GMT -4. The time now is 01:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy