Hi, I need to trigger mstr events throuch unix by looking at a trigger file in a directory. For this i have created a text file (mstr_otc_st_events.txt) with trigger file and event name. Like this i have 3 trigger files and 3 events. The file is as follows,
Trigger1.TX|TRIGGER EVENT "First daily load complete
Trigger2.TX|TRIGGER EVENT "Second daily load complete"
Trigger3.TX|TRIGGER EVENT "Third daily load complete"

and the code is,
awk -F"|" '{
if (!system("test -f " $1))
{
print $1 " exists\nTriggering the MSTR event\n"
mstr_text_file="/tmp/mstr_text_'`date +"%Y-%m-%d"`.txt'"
print $2 > mstr_text_file
if(!system("/u01/app/MicroStrategy/bin/mstrcmdmgr -n '"$MSTR_PROJECT_NAME"' -u '"$MSTR_USER_NAME"' -p '"$MSTR_PASSWORD"' -f "mstr_text_file" -o '"$log_file_name"'"))
{
subject=$3
message=$4
system("/u01/app/admin/scripts/ksh/send_mail.ksh -s "subject" -f '"$POS_FROM_EMAIL_ID"' -t '"$POS_TO_EMAIL_ID"' -m "message"")
}
else
{
print "Failure"
}
close(mstr_text_file)
system("rm -f " $1)
}
}' ${SCRIPT_FILE_LOCATION}/mstr_otc_st_events.txt

This will trigger events dynamically by looking at text file. I can add more trigger files and events and use the same code without disturbibg it.

Now the problem is i am not able to trigger more than one event by looking at one trigger file. The new file is as follws,
Trigger1.TX|TRIGGER EVENT "First daily load complete"|TRIGGER EVENT "First daily load complete _ File"|TRIGGER EVENT "First weekly load complete"
Trigger2.TX|TRIGGER EVENT "Second daily load complete"|TRIGGER EVENT "First daily load complete _ File"
Trigger3.TX|TRIGGER EVENT "Third daily load complete"|TRIGGER EVENT "First daily load complete _ File"

I have to trigger $2, $3, $4 by looking at $1. I am not able to loop through the same row. How do i do it? Please help..