Parsing a Complicated properties file

Hi All,

I have a requirement to parse a file.

Let me clear you all on the req.

I have a job which contains multiple tasks and each task will have multiple attributes that will be in the below format. Each task will have some sequence number according to that sequence number tasks shld execute.

S.No.  SeqNo# TaskID |Task Name | Attribute Name| Attribute Value
1          1           1     |  Java                  |      classpath     | sample.jar
2          1           1     |  Java                  |      Runtime        | -Xms -512
3          2           2     |  StoredPro        |      DB                   |  sample.ini
4          2           2     |  StoredPro        |      ProcName     | get_emp() 

Like in the above format the infomation is written into the file.

The above job has 2 tasks (java, storedPro) with multiple attributes to each job. For example Java:- classpath, Runtime

I want to parse the file and and pick up the task and its attributes and execute as per the sequence number like java has to execute first with all attributes and stored proc fallows.

Please advice how can i achieve this.

Appriciate if any links or sample code.

Thanks
Raj

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums