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
parsing logfiles (performance issue) subin_bala Shell Programming and Scripting 4 05-06-2008 02:35 AM
Logfiles E-mailed deep_kol Shell Programming and Scripting 4 06-25-2007 05:51 PM
Output all commands to logfiles ??? fawqati UNIX for Advanced & Expert Users 2 06-21-2006 04:47 AM
Controlling logfiles nhatch UNIX for Dummies Questions & Answers 5 08-08-2002 01:11 AM
Logfiles brahill UNIX for Dummies Questions & Answers 3 10-16-2000 03:37 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 11-07-2008
clzupp clzupp is offline
Registered User
  
 

Join Date: Nov 2008
Location: Germany
Posts: 1
Thumbs down split monthly logfiles into daily logfiles

Hi,

I have a lot of logfiles like fooYYYYMM.log (foo200301.log, foo200810.log) with lines like
YYYY-MM-DD TIMESTAMP,text1,text2,text3...
but I need (for postprocessing) the form fooYYYYMMDD.log (so foo200402.log becomes foo20040201.log, foo20040202.log...)
with unmodified content of lines.

Thanks for any help!
Uwe
  #2 (permalink)  
Old 11-07-2008
BubbaJoe's Avatar
BubbaJoe BubbaJoe is offline
Registered User
  
 

Join Date: Oct 2008
Location: St Louis
Posts: 153
for i in `ls foo*.log`
do
awk ' {f="foo"$1".log"; print > f}' $i
done
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 01:04 PM.


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