Computing.Net > Forums > Unix > tables in ksh script

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

tables in ksh script

Reply to Message Icon

Original Message
Name: johanpeetermans
Date: August 23, 2005 at 02:39:38 Pacific
Subject: tables in ksh script
OS: sunos
CPU/Ram: /
Comment:

Hi,
I just started scripting in unix and I have no idea to solve my problem:

need to put some data I get form my log files into the following layout

--------------01/01/06-02/01/06-03/01/06 ...
system1
--instance1----'data'---'data'--'data'
--instance2----'data'---'data'--'data'


system2
--instance1----'data'---'data'--'data'
--instance2----'data'---'data'--'data'
.
.
.
The 'data' consists of error codes like 0= ok
101= not ok
104= not applicable
every day the file will be updated:
in the beginnen the table will be empty,
01/01/06 the first column will updated,
02/01/06 the second
...

Can anyone help me?
Thx
BR Johan Peetermans


Report Offensive Message For Removal


Response Number 1
Name: David Perry
Date: August 23, 2005 at 07:39:35 Pacific
Reply:

If you are not using a rdbms, the output would be much easier to update if the lines looked like

system1 --instance1----'data'---'data'--'data'

all on one line

Then you would do somthing like

sed -e "s/\(system1 --instance1.*\)/\1 'newdata'" oldfile > newfile

You can modify more than one line / pass by passing additional criteria with additional "-e" flags.


Report Offensive Follow Up For Removal

Response Number 2
Name: johanpeetermans
Date: August 24, 2005 at 00:36:23 Pacific
Reply:

Thx David, I 'll try it today!
BR Johan


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home



Results for: tables in ksh script

ksh script
    Summary: Hi all, I'm trying to prompt user for input using "read" in ksh script. I want to quit, if the user doen't input any value for say "45" seconds. Can anyone help me accomplish this task? Thanks ...
www.computing.net/answers/unix/ksh-script/3505.html

SQL in shell script
    Summary: In shell script I am inserting the record in to the table.After excuation the script output is commit complete which is fine but I need my echo should be display like "Account created" #!/bin/ksh . . ...
www.computing.net/answers/unix/sql-in-shell-script/5538.html

no. of instances of a script in ksh
    Summary: Please if someone can tell me how to find out if the script has multiple instances running if any and how to know the exact count in ksh? ...
www.computing.net/answers/unix/no-of-instances-of-a-script-in-ksh/6739.html








Which MP3 player do you have?

iPod/iPhone
Zune
Something Else
None


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History






Data Recovery Software