![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Script for Reading a Password file | srirams | Shell Programming and Scripting | 2 | 03-07-2007 10:20 AM |
| Script for reading an input file | gzs553 | Shell Programming and Scripting | 1 | 10-17-2006 07:55 AM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
| script to reading a file | vasikaran | UNIX for Dummies Questions & Answers | 3 | 07-26-2005 06:28 AM |
| Reading a file into a C++ script | Breen | High Level Programming | 1 | 10-08-2003 07:04 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Script for reading .csv file
Can someone please help me to write script for following scenario :
1> script should read a input .csv file of format : EmpName, PF, Leave, Basic ,HRA 2> another config file ( may be again a .csv file ) has format EmpName and EmpID 3> script should read another config file for each EmpName in the input file , to find the EmpID 4> After finding EmpID from config file, all records need to be written in 3rd file ( output file ) with format : EmpName ,EmpID ,PF, Leave ,Basic ,HRA Thanks |
|
||||
|
awk
Hi,
input: Code:
a: leo pf1 leave1 basic1 hra1 james pf2 leave2 basic2 hra2 tony pf3 leave3 basic3 hra3 b: leo 210375 james 210075 tony 210378 Code:
leo 210375 pf1 leave1 basic1 hra1 james 210075 pf2 leave2 basic2 hra2 tony 210378 pf3 leave3 basic3 hra3 Code:
awk '
{
if (NF==2)
id[$1]=$2
else
print $1,id[$1],$2,$3,$4,$5
}' b a
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|