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
split and making an array inside another array dcfargo Shell Programming and Scripting 2 08-06-2008 11:07 AM
Array inside an array manas_ranjan UNIX for Advanced & Expert Users 5 06-10-2008 03:25 PM
create array holding characters from sring then echo array. rorey_breaker Shell Programming and Scripting 5 09-28-2007 09:42 AM
looping a array inside inside ssh is not working, pls help reldb Shell Programming and Scripting 5 07-07-2006 11:32 AM
inside the JVM rein UNIX for Advanced & Expert Users 1 08-05-2005 02:57 PM

 
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 08-07-2008
subin_bala subin_bala is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 57
using array inside awk

Hi All,

I have the following code sequence for reading some bulk file and moving the content to two different arrays.

while read data
do
THREEG_PATTERN=`echo $data | egrep "3G"`
if [ "$data" == "$THREEG_PATTERN" ]
then
NEW_THREEG_PATTERN=`echo $THREEG_PATTERN | cut -d " " -f2`
THREEG_ARRAY[$IDX]=$NEW_THREEG_PATTERN
IDX=$(($IDX+1))
else
SP_ARRAY[$IDX_SP]=$data
IDX_SP=$(($IDX_SP+1))
fi

done < $_pat


This code is working perfectly but this is taking long time because of big file size.... How can i improve the performance of this process by using awk or other mechanism? Or how can i convert this entire code to awk? Looking forward ur reply

Thanks in advance
Subin
 

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:06 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