* Read multiple column figure.
@ 1999-03-24 5:00 Forest Gum
1999-03-24 5:00 ` Adam Price
1999-03-25 5:00 ` Forest Gum
0 siblings, 2 replies; 3+ messages in thread
From: Forest Gum @ 1999-03-24 5:00 UTC (permalink / raw)
Dear All,
Does any one have the ready procedure to capture the source data that in
column format into field.
For example :
Month A sales B sales C sales
Feb 100 K 200 K 200 K
Mar 100 K 300 K
I want to capture field A_total = X + Y where X = 100K and Y = 100K.
Thanks !
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Read multiple column figure.
1999-03-24 5:00 Read multiple column figure Forest Gum
@ 1999-03-24 5:00 ` Adam Price
1999-03-25 5:00 ` Forest Gum
1 sibling, 0 replies; 3+ messages in thread
From: Adam Price @ 1999-03-24 5:00 UTC (permalink / raw)
Forest Gum wrote in message <7dahag$ncl$1@m5.att.net.hk>...
>Dear All,
>
>Does any one have the ready procedure to capture the source data that in
>column format into field.
>
>For example :
>
>Month A sales B sales C sales
>Feb 100 K 200 K 200 K
>Mar 100 K 300 K
>
>I want to capture field A_total = X + Y where X = 100K and Y = 100K.
>
>Thanks !
>
>
What OS, What language, what format of input,
This might work on unix (No machine at home to try it on)
If you want VMS or RSX11 then somebody else will have to help.
Or you could buy a spread-sheet program.
#!/bin/sh
DATA_FILE=$1
grep -v '^Month' $DATA_FILE | \
awk 'BEGIN {total=0}
$3=="K" {total =total +(1000 * $2) ; $2=0}
{total=total+$2}
END{print total / 1000 , "K"}'
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Read multiple column figure.
1999-03-24 5:00 Read multiple column figure Forest Gum
1999-03-24 5:00 ` Adam Price
@ 1999-03-25 5:00 ` Forest Gum
1 sibling, 0 replies; 3+ messages in thread
From: Forest Gum @ 1999-03-25 5:00 UTC (permalink / raw)
Sorry for not stating details.
I want to write DCL script on OpenVMS 71. to capture those data from file
and write to another file (that no problem for me), the difficult is
how/what lexical function use to read data and assign different column data
into field within a line as example below. Your help is much appreciated.
Thanks.
Forest Gum wrote in message <7dahag$ncl$1@m5.att.net.hk>...
>Dear All,
>
>Does any one have the ready procedure to capture the source data that in
>column format into field.
>
>For example :
>
>Month A sales B sales C sales
>Feb 100 K 200 K 200 K
>Mar 100 K 300 K
>
>I want to capture field A_total = X + Y where X = 100K and Y = 100K.
>
>Thanks !
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1999-03-25 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-03-24 5:00 Read multiple column figure Forest Gum
1999-03-24 5:00 ` Adam Price
1999-03-25 5:00 ` Forest Gum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox