T
Troll
Hi,
I need to write a script which reads some data and reports the findings.
Just to give you an idea the structure is similar to the following.
Data input example:
HEADING 1
**********
ColumnA ColumnB ColumnC ColumnD ColumnE
Pete Male Marketing Single 40
Kate Female Marketing Married 30
John Male Sales Married 38
Pete Male Sales Single 52
John Male Sales Single 24
HEADING 2
**********
ColumnF ColumnG ColumnH ColumnI
whatever
whatever
whatever
whatever
Report Output example:
# of Pete's =
# of Males =
# of Salespeople =
# of Singles =
# of over 35s =
Since this is the first time I'm even writing such a script I would
appreciate some pointers.
1) Do I use arrays or associate arrays for this? Why or why not?
2) Is it possible for someone to give me a code example of counting how many
Singles we have?
3) What happens when I have read all the data under HEADING 1 and need to
move onto HEADING 2?
That is, how do I accomplish the jump from what I think is one loop onto the
next?
I imagine that there will be many more posts following this one so there's
no need to get into too much detail. Some guidance would be nice as I will
need to utilise Google and my references for the rest.
Thanks in advance.
I need to write a script which reads some data and reports the findings.
Just to give you an idea the structure is similar to the following.
Data input example:
HEADING 1
**********
ColumnA ColumnB ColumnC ColumnD ColumnE
Pete Male Marketing Single 40
Kate Female Marketing Married 30
John Male Sales Married 38
Pete Male Sales Single 52
John Male Sales Single 24
HEADING 2
**********
ColumnF ColumnG ColumnH ColumnI
whatever
whatever
whatever
whatever
Report Output example:
# of Pete's =
# of Males =
# of Salespeople =
# of Singles =
# of over 35s =
Since this is the first time I'm even writing such a script I would
appreciate some pointers.
1) Do I use arrays or associate arrays for this? Why or why not?
2) Is it possible for someone to give me a code example of counting how many
Singles we have?
3) What happens when I have read all the data under HEADING 1 and need to
move onto HEADING 2?
That is, how do I accomplish the jump from what I think is one loop onto the
next?
I imagine that there will be many more posts following this one so there's
no need to get into too much detail. Some guidance would be nice as I will
need to utilise Google and my references for the rest.
Thanks in advance.