On Thursday 09 August 2001 01:08 pm, Marvin T. Pascual wrote:
> ----- Original Message -----
> From: Rafael 'Dido' Sevilla <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, August 09, 2001 11:30 AM
> Subject: Re: [plug] [ OT ] HELP on Korn Shell Scripting
>
> > How could I compare integers (date) one-by-one from the format of
> > 2000081015533160460708 to 08/10/2000 where the first 4 integers stands
> > for the year (2000), the next 2 integers stands for the month (08 ==
> > August), and the next 2 integers stands for the day (10) so that we
> > conclude that 2000081015533160460708 == 08/10/2000? Please ignore the
> > integers after
>
> the
>
> > day (15533160460708).
>
> Since we are using Oracle as our database, I've got an idea to call SQL
> (SUBSTR to_date...) to convert the problem located above this message.
> I'll just read more docs on ksh scripting 'cause I admit that I lack
> knowledge on it. Anyway, anybody from this list has a copy of Korn Shell
> Programming docs? Would you mind to send it to me 'cause I don't have any
> docs here regarding ksh programming? Sad to say, malungkot ulit ako kasi
> wala na akong access ng internet dito sa office eh kaya hindi na ako
> makapag-browse sa net. :-( huhuhu...
>
> Regarding Perl, I can't make it here in our office 'cause Perl is not
> installed in any of our sites all over the country. Sayang nga...
>
> Anyway, thanks in advance especially to you Dido for your prompt reply.
>
> Marvin
>
If you had the gawk, you could, create a korn script, perhaps called tst.sh
#!/bin/ksh
gawk \
BEGIN { FIELDWIDTHS = "4 2 2" }
{ print $2 "/" $3 "/" $1 }
and fire it up by (after making it executable)
./tst.sh < data.file > new.data.file
> _
> Philippine Linux Users Group. Web site and archives at
> http://plug.linux.org.ph To leave: send "unsubscribe" in the body to
> [EMAIL PROTECTED]
>
> To subscribe to the Linux Newbies' List: send "subscribe" in the body to
> [EMAIL PROTECTED]
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]