Your problem seems solvable with a program written in Perl.
We will be very glad to help you with any specific issue related to Perl programming you may find. Good luck! | [reply] |
Whenever I need to pull particular columns out of a file, my weapon of choice for small scripts is awk(1) if the columns are delimited, or cut(1) if they're fixed length. If things get even slightly complicated, perl with Text::CSV_XS. | [reply] |
I'm not understanding the problem, but read about: perl regexes and split or print $F[X] where X is the number of the desired column minus one. (i.e: print "$F[0], $F[4]"; prints the first and fifth columns)
| [reply] [d/l] [select] |
| [reply] |
First blush ...
1):- Need to get the worst path report, basically there is a word "slack" in this file & we need to search for that. each slack belongs to a particular start & end point. we need to get all the lines from "startpoint" to "slack" for this worst slack number. 2):- Now as we got the worst path, once section of this is data path & other is clock path, we need to get the all the lines from startpoint to "data arrival time". 3):- now we need to make a table from first column & fifth column in this table .sort this table & find the worst delay gate in this path.
Presumably, this is a “line by line” massive text file – who really cares how many hundreds of megabytes it is, which presumably consists of lines that begin-with or that contain (among other things) startpoint and slack. Therefore, your first order of business will be to know how to identify those lines, and how to parse interesting bits of data from them. Your description implies that slack_number is some kind of grouping-field but does not explain what that might be ... is the input-file, for instance, “sorted by” that field?
Moving on ... presumably the presence of a startpoint record marks the beginning of a new group (hence, the ending of the previous one), and slack, say, denotes the presence of some “interesting-to-us” data point within the present group. I also deduce that this data must contain data_path and clock_path. So now, at this point, I can hazard a guess as to what marks the boundaries of a particular “set of data” within this file, and what constitutes “interesting data points” within each set.
Moving on, I see a very vague (so far ...) description of what you actually want to do with each set of data ... however many such sets-of-data there might be ... expressed (as usual) in terms of what you wish to be “the final output.” Unfortunately, at this point there are simply too-many unanswered questions.
At this point, I suggest that you add a new post to this thread, including a representative sample of the data records (i.e. enough to clearly show at least two groups of data). Given this, you will probably get enough specific details to enable you to create the final solution to this problem ... yourself. There is at this point no question in my mind that Perl can give you what you are looking for, and that it is a very-appropriate power tool by which to do so.
| |