Sponsored Content
Top Forums Shell Programming and Scripting Extracting data based on the list file Post 302445814 by pravin27 on Tuesday 17th of August 2010 02:29:24 AM
Old 08-17-2010
Hi,

It's working fine at my end.


Code:
[root@powerbroker pravin]# cat f3
nokia1100    123,000
nokia2100    66,000
samsung123    11,000
samsung456    23,000
iphone432    234,000
iphone678    123
cherry679    11,000
cherry123    67,456
nokia660    345,222
nokia_series    123,321
nokia4200    23,645
samsung_series    23,978

[root@powerbroker pravin]# cat f4
nokia1100
iphone678
nokia4200
cherry123
test


[root@powerbroker pravin]# awk 'NR==FNR{a[$1]=$2;next}
a[$1] {print $1,a[$1]}' f3 f4
nokia1100 123,000
iphone678 123
nokia4200 23,645
cherry123 67,456

This User Gave Thanks to pravin27 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting data from text file based on configuration set in config file

Hi , a:) i have configuration file with pattren <Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output> eg: myfile.confg 9899000000,9899999999,DATA,b.dat 9899000000,9899999999,SMS,a.dat b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies

2. Shell Programming and Scripting

Extracting lines in file based on time

Hi, anyone has any ideas on how do we extract lines from a file with format similiar to this: (based on current time) Jun 18 00:16:50 .......... ............. ............ Jun 18 00:17:59 .......... ............. ............ Jun 18 01:17:20 .......... ............. ............ Jun 18... (5 Replies)
Discussion started by: faelric
5 Replies

3. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

4. Shell Programming and Scripting

Extracting data between tags based on search string from unix file

Input file is on Linux box and the input file has data in just one line with 1699741696 characters. Sample Input: <xxx><document coll="uspatfull" version="0"><CMSdoc>xxxantivirus</CMSdoc><tag1>1</tag1></document><document coll="uspatfull"... (5 Replies)
Discussion started by: gaya
5 Replies

5. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

6. Shell Programming and Scripting

extracting lines based on condition and copy to another file

hi i have an input file that contains some thing like this aaa acc aa abc1 1232 aaa abc2.... poo awq aa abc1 aaa aaa abc2 bbb bcc bb abc1 3214 bbb abc3.... bab bbc bz abc1 3214 bbb abc3.... vvv ssa as abc1 o09 aaa abc4.... azx aaq aa abc1 900 aqq abc19.... aaa aa aaaa abc1 899 aa... (8 Replies)
Discussion started by: anurupa777
8 Replies

7. Shell Programming and Scripting

Generate tabular data based on a column value from an existing data file

Hi, I have a data file with : 01/28/2012,1,1,98995 01/28/2012,1,2,7195 01/29/2012,1,1,98995 01/29/2012,1,2,7195 01/30/2012,1,1,98896 01/30/2012,1,2,7083 01/31/2012,1,1,98896 01/31/2012,1,2,7083 02/01/2012,1,1,98896 02/01/2012,1,2,7083 02/02/2012,1,1,98899 02/02/2012,1,2,7083 I... (1 Reply)
Discussion started by: himanish
1 Replies

8. Shell Programming and Scripting

Script for extracting data from csv file based on column values.

Hi all, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (3 Replies)
Discussion started by: Vivekit82
3 Replies

9. UNIX for Dummies Questions & Answers

Extracting data from one file, based on another file (splitting)

Dear All, I have two files but want to extract data from one based on another... can you please help me file 1 David Tom Ellen and file 2 David|0010|testnamez|resultsz David|0004|testnamex|resultsx Tom|0010|testnamez|resultsz Tom|0004|testnamex|resultsx Ellen|0010|testnamez|resultsz... (12 Replies)
Discussion started by: A-V
12 Replies

10. Shell Programming and Scripting

In PErl script: need to read the data one file and generate multiple files based on the data

We have the data looks like below in a log file. I want to generat files based on the string between two hash(#) symbol like below Source: #ext1#test1.tale2 drop #ext1#test11.tale21 drop #ext1#test123.tale21 drop #ext2#test1.tale21 drop #ext2#test12.tale21 drop #ext3#test11.tale21 drop... (5 Replies)
Discussion started by: Sanjeev G
5 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 03:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy