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
Formatting of file to an desired one pkondur Shell Programming and Scripting 5 04-02-2008 01:26 AM
chmod not working as desired JamesByars UNIX for Dummies Questions & Answers 2 02-21-2008 01:30 PM
Desired Format ! prasanth_babu HP-UX 1 02-20-2008 10:31 AM
Help me in getting the desired output akash Shell Programming and Scripting 2 12-02-2007 11:27 AM
get the timestamp of a file in desired format sumeet UNIX for Advanced & Expert Users 1 03-08-2007 12:24 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 07-23-2006
mhssatya mhssatya is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 57
Please Read REBORG

Reborg,

Sorry to bother you. I have tried the code you suggested and it's not creating new files after they satisfy the criteria. If any of the files don't satisfy the criteria it should not create the files at all. Please see my output below.



Quote:
+ dev=/biddf/ab6498/dev/ctl
+ cd /biddf/ab6498/dev/ctl
+ echo /biddf/ab6498/dev/ctl
/biddf/ab6498/dev/ctl
+ + date +%Y%m%d
files=CARE01_DLY_???_20060723
+ echo CARE01_DLY_AUS_20060723 CARE01_DLY_MKT_20060723
CARE01_DLY_AUS_20060723 CARE01_DLY_MKT_20060723
+ awk {data[NR] = $0; out=FILENAME "new"; file[NR]=out;} END { if ( FNR
- 2 != $1) { print "error" ; exit 1 } if ( ARGIND == --ARGC ){ for ( i=2
; i < NR; i++ ) { print data[i] > file[i] } close(file[i])}}
CARE01_DLY_AUS_20060723 CARE01_DLY_MKT_20060723

Last edited by mhssatya; 08-17-2006 at 06:48 PM.. Reason: Reborg can answer it faster if he sees it!!!!
 

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