Page 1 of 1

To read one line of record from a file

Posted: Thu Sep 29, 2011 12:23 am
by agathaeleanor
Hi all,

I have a file (email.txt) which stores user emails and the subject area.

Format:
email1@domain,email2@domain,email3@domain|subject1
email21@domain|subject2
email31@domain,email32@domain|subject3
I created a sequencer contains
execute_command(cat) --> UVA --> Parallel Job --> Notification_activity

execute_command, it cat email.txt
UVA, define user_email variable to store email address from email.txt

code:
Ereplace(Field(EC_CAT.$CommandOutput,"|",1,-1),@FM,'')

Notification_activity will inherit value from user_email variable in UVA

In the user_email will always return first row from email.txt.
May I know if there is a way to read second row of record from email.txt based on the subject area (pass in as parameter)

Thanks in advance for your help.

Posted: Thu Sep 29, 2011 12:33 am
by ray.wurlod
If the subject areas are distinct, you could use grep command to read the line from the file.

Posted: Thu Sep 29, 2011 1:37 am
by agathaeleanor
Thanks ray. It works :)