updating column in line with ex or any other way.

From: Johnny Koen (Johnny.Koen@Investec.co.za)
Date: Mon Jun 14 2004 - 11:32:07 EDT


Hi All

I'm having trouble writing a script to search for a specific line in a
file and update a specific column in that line. For example

/usr/sbin/syslogd:1:Y:Y:Y:Y:N:-:-:SYSLOGD:it-operations:0835014718
0829291274

It must search the file until it reaches this line "the easy part" and
then as you can see the file is separated by ":" find the 8th field and
update it from Y --> N "the part I'm not getting right.

At this moment I'm using ex to edit and search for the line but the
updating of the column seems a bit more difficult to achieve. I know
that the easiest thing would be to search and delete the line and then
just add my modified line to the end of the file, but that is not the
proper way to do this. This line would not be the only line to edit, but
all the line looks the same "amount of clumns"

Many thanks is advance.

Cheers

Johnny

IMPORTANT NOTICE:

If you are not the intended recipient of this email (or such person's
authorised representative), then :

(a) please notify the sender of this email immediately by return email,
facsimile or telephone and delete this message from your system;
(b) you may not print, store, forward or copy this message or any part thereof
or disclose or cause information in this message to be
disclosed to any other person.

The information in or attached to this email message is confidential and may
be subject to legal privilege and client confidentiality.
In addition this message is subject to important restrictions, qualifications
and disclaimers ("the disclaimer") that must be accessed and
read by copying the following address into your Internet browser's address bar
: http://www.investec.com/emaildisclaimer/

The disclaimer also provides our corporate information and names of our
directors as required by law.

The disclaimer is deemed to form part of this message in terms of Section 11
of the Electronic Communications and Transactions Act 25 of 2002.
If you cannot access the disclaimer, please obtain a copy thereof from us by
sending an email to : disclaimer@investec.co.za
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:28:52 EDT