Assigning Column Values to ARRAY in ksh

Hi ,

i have file which is having two fields in it (#delimited)
ABC#FILE_01.DAT
DEF#FILE_02.DAT

i want to write first field values to one array example A_01 and second field values to B_02 array

please let me know how to do this ,my final requirement i have send out a mail for each record in file by making first field value as subject and second filed value as content of the mail (the no of records in file will not constant it will changing if a new file arrive )

output example

SUBJECT: ABC

The below file have been processed .(we need to append this line at the begin)

FILE_01.DAT

Why you need arrays? You could code:

#!/bin/ksh

while read line
do
  subj=${line%%#*}
  file=${line##*#}
  echo "Below file has been processed:\n $file" | mailx -s "Subject: $subj" user@domain.com
done < file

This is one way to do to:

#!/bin/ksh
# Process records in data file

RECIPIENTS="user1@abc.com;user2@abc.com"

# function: email_file is used to email file to recipients
email_f ()
{
mutt -s "$SUBJECT" ${RECIPIENTS} <<EMAIL
${BODY}
EMAIL
return
}


while IFS="#" read f1 f2
do
  SUBJECT="$f1"
  BODY="The file($f2) has been processed."
  email_f
done <your_file_name.txt