The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Reading Of Array Element in Unix ravi_rn Shell Programming and Scripting 2 12-30-2008 02:48 PM
Reading from while loop into an array ssuresh1999 UNIX for Dummies Questions & Answers 2 08-12-2008 11:53 AM
combining fields in two text fields shocker Shell Programming and Scripting 3 01-16-2008 11:27 AM
split varibles and store fields into shell varible array gratus Shell Programming and Scripting 3 10-11-2007 02:50 PM
Reading data into muti-dimentional array - in perl zap Shell Programming and Scripting 5 05-04-2004 10:15 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-22-2009
pinnacle pinnacle is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 182
awk reading many fields to array

I want to read $3,$4,$5,$6,$7 of fileA in array and when
fileb $1 = fileA $4
the i want to print array and few fields from fileB.

This should work but has some syntax error.

Code:
nawk -F, 'FNR==NR{a[$1]=[$3,$4,$5,$6,$7];next} a[$4]{print a[$4,$1,$2,$3]}' fileB fileA

Appreciate if someone can correct this.
 

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 09:04 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