Need help on writing SUM totals from input
Posted: Wed Jun 16, 2010 10:25 pm
Hi,
I have this input as listed below
I need to include a trailer line with a consolidated total of each column like this
The percentage calculation under column E is D/C %
The percentage calculation under column H is (D-G)/C %
I have this input as listed below
C D E F G H
----+----1----+----2----+----3----+----4----+----5----+----6
CORPBOND~0001415~0000004~000.282%~0001409~-0000002~000.424%~
EQUITY ~0000092~0000008~008.695%~0000081~-0000003~011.956%~
GENERAL ~0000002~0000002~100.000%~0000000~-0000000~100.000%~
GOVTBOND~0000196~0000001~000.510%~0000190~-0000005~003.061%~
LTDPART ~0000001~0000001~100.000%~0000000~-0000000~100.000%~
MONEYMKT~0000040~0000014~035.000%~0000038~+0000012~005.000%~
MORTGAGE~0000795~0000143~017.987%~0000652~-0000000~017.987%~
MUNIBOND~0000129~0000090~069.767%~0000062~+0000023~051.937%~
MUTUALFD~0000090~0000000~000.000%~0000082~-0000008~008.888%~
OPTION ~0000113~0000000~000.000%~0000113~-0000000~000.000%~
RECEIPT ~0000002~0000000~000.000%~0000002~-0000000~000.000%~
UNITS ~0000009~0000009~100.000%~0000004~+0000004~055.555%~
C D E F G H
----+----1----+----2----+----3----+----4----+----5----+----6
CORPBOND~0001415~0000004~000.282%~0001409~-0000002~000.424%~
EQUITY ~0000092~0000008~008.695%~0000081~-0000003~011.956%~
GENERAL ~0000002~0000002~100.000%~0000000~-0000000~100.000%~
GOVTBOND~0000196~0000001~000.510%~0000190~-0000005~003.061%~
LTDPART ~0000001~0000001~100.000%~0000000~-0000000~100.000%~
MONEYMKT~0000040~0000014~035.000%~0000038~+0000012~005.000%~
MORTGAGE~0000795~0000143~017.987%~0000652~-0000000~017.987%~
MUNIBOND~0000129~0000090~069.767%~0000062~+0000023~051.937%~
MUTUALFD~0000090~0000000~000.000%~0000082~-0000008~008.888%~
OPTION ~0000113~0000000~000.000%~0000113~-0000000~000.000%~
RECEIPT ~0000002~0000000~000.000%~0000002~-0000000~000.000%~
UNITS ~0000009~0000009~100.000%~0000004~+0000004~055.555%~
C D E F G H
I need to include a trailer line with a consolidated total of each column like this
TOTALS 2884 272 9.43% 2633 21 8.70%
The percentage calculation under column E is D/C %
The percentage calculation under column H is (D-G)/C %