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
Cut the last field 435 Gavea Shell Programming and Scripting 9 03-17-2009 01:04 PM
Retrieve 5th Field to Last Field !! jobbyjoseph UNIX for Dummies Questions & Answers 3 05-16-2007 04:20 AM
ip address octet increments Naanu High Level Programming 8 03-26-2007 05:42 PM
Moving Part of a field to another field using AWK rjsha1 Shell Programming and Scripting 5 08-04-2006 06:39 AM
add increment field when first field changes azekry Shell Programming and Scripting 2 11-14-2005 04:21 PM

Closed Thread
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
  #1 (permalink)  
Old 03-03-2007
greengrass greengrass is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 9
Working with field increments

I have a new challenge that I need some help with. Each morning I have two files that contain working units and failed units that I join together to form file3 which is FTP to server for comparison against billing system.

My problem, I would like to take joined data in file3 and add a field that would increase the count by 1 for any unit found to be a failed unit. The count would continue until the failed unit is removed, which could be in excess of 365 days or next day. Both failed and working files change daily.

File1 working units change daily but average around 125,000 and file2 failed unit’s average 25,000, totaling 150,000 records in file3. I will use cron to run script daily.

Sample file3 output current:

123xxx|123xxx|123xxx|123xxx|123xxx|current field|
123xxx|123xxx|123xxx|123xxx|123xxx|current field|
123xxx|123xxx|123xxx|123xxx|123xxx|current field|

New file3 output:

123xxx|123xxx|123xxx|123xxx|123xxx|current field|failed count days
123xxx|123xxx|123xxx|123xxx|123xxx|current field| 1
123xxx|123xxx|123xxx|123xxx|123xxx|current field| 2
123xxx|123xxx|123xxx|123xxx|123xxx|current field| 34
123xxx|123xxx|123xxx|123xxx|123xxx|current field| 57
123xxx|123xxx|123xxx|123xxx|123xxx|current field| 365
  #2 (permalink)  
Old 03-03-2007
cfajohnson's Avatar
cfajohnson cfajohnson is offline Forum Advisor  
Shell programmer, author
  
 

Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
What does the input look like?

Last edited by reborg; 03-03-2007 at 08:23 PM.. Reason: remove useless quoting of previous post
  #3 (permalink)  
Old 03-03-2007
greengrass greengrass is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 9
00:00:00:00:00:00|macaddress|10.xx.xx.xxx|31|2|xx00|25|part100001|
00:00:00:00:00:00|macaddress|10.xx.xx.xxx|32|4|x100|14|part100002|
00:00:00:00:00:00|macaddress|10.xx.xx.xxx|37|6|x150|10|part100003|
00:00:00:00:00:00|macaddress|10.xx.xx.xxx|41|5|x200|25|part100004|
Closed Thread

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 10:52 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