PERL data - sorting

Hello,

I have a page where multiple fields and their values are displayed. But I am able to sort only a few fields. When I looked into the issue, it is seen that the for each row of info , an unique id is generated and id.txt is generated and saved. Only those fields which are inside that id.txt are capable of getting sorted.

Can someone help me to make more fields to be saved in that file?

Thanks

Post some sample data and the code you are using to sort the data. Explain the data formating if necessary.

In the html page, I have the format

Type id Status Open Title
Requirement 00325 In-progress 2008-06-18 Field updation status
Coding 00301 Closed 2008-05-23 Requirement analysis status

Stored files

cat data00325.txt
[info]
status: In-progress
open: 2008-06-18
title : Field updation status

cat data00301.txt
[info]
status: Closed
open: 2008-05-23
title : Requirement analysis status

As Type is not stored in data files, I believe we can't sort by that. I am able to sort by status/open/title. I am exploring how status field is getting into the data file and why not 'Type' field. I believe if that gets into the file, I can sort by that too.

As a beginner in perl, seeking your guidance.

HTML files usually have some html markup code in them. But anyway, if you have a file like this:

Requirement 00325 In-progress 2008-06-18 Field updation status
Coding 00301 Closed 2008-05-23 Requirement analysis status

You would split the file using the split() function into an array and do whatever it is you need to do with the data.

open (FH, 'thefile.html') or die "$!";
while (<FH>){
   chomp;
   my @data = split(/\s/,$_,5);
   # now the data is split into five fields, for example:
   $data[0] = Requirement
   $data[1] = 00325
   $data[2] = In-progress
   $data[3] = 2008-06-18
   $data[4] = Field updation status
   # from here I have no idea what you need to do
}
close (FH);