The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
lookup in a list migurus Shell Programming and Scripting 3 11-24-2008 12:44 AM
Clueless about how to lookup and reverse lookup IP addresses under a file!!.pls help choco4202002 UNIX for Advanced & Expert Users 0 08-26-2008 02:28 PM
lookup in unix dr46014 Shell Programming and Scripting 5 05-03-2008 08:38 AM
file Lookup using awk jerome Sukumar Shell Programming and Scripting 1 08-30-2007 04:28 AM
lookup script tampaJim Shell Programming and Scripting 2 04-30-2007 11:35 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-01-2009
dr46014 dr46014 is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 95
lookup

I have a lookup file in unix say /data/lkp.dat (First line is header and space delimited) and the content is shown below.
Another file which contains the job_name and rec_count lets say /data/data_file.dat(no header pipe delimited file).
Now i want to do a lookup on job_name and my output should be 4 files
TYPE1_File1
TYPE2_File2
TYPE3_File3
TYPE4_File4

depending on TYPE field.The output should be a | delimited file
and the layout will be

FILE_NAME
REC_COUNT




Code:
JOB_NAME	FILE_NAME	TYPE
A_1	HGG.dat	TYPE1
B_1	SDF.dat	TYPE1
C_1	FHH.dat	TYPE1
D_1	UUU.dat	TYPE1
E_1	UUKK.dat	TYPE1
A_2	HGG.dat	TYPE2
B_2	SDF.dat	TYPE2
C_2	FHH.dat	TYPE2
D_2	UUU.dat	TYPE2
E_2	UUKK.dat	TYPE2
A_3	HGG.dat	TYPE3
B_3	SDF.dat	TYPE3
C_3	FHH.dat	TYPE3
D_3	UUU.dat	TYPE3
E_3	UUKK.dat	TYPE3
A_4	HGG.dat	TYPE4
B_4	SDF.dat	TYPE4
C_4	FHH.dat	TYPE4
D_4	UUU.dat	TYPE4
E_4	UUKK.dat	TYPE4


Last edited by Yogesh Sawant; 04-01-2009 at 02:51 PM.. Reason: added code tags
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0