kshitij has asked for the wisdom of the Perl Monks concerning the following question:
Hi Guys , I am working on one perl script to create one output file based on some data processing on my input file in a different format.
Input file
########################################### pat1 U_TOP_LOGIC/i_reg_2_/Q : # {111111}111 pat2 U_TOP_LOGIC/i_reg_2_/Q : # {110111}111 pat3 U_TOP_LOGIC/i_reg_2_/Q : # {110111}011 pat4 U_TOP_LOGIC/i_reg_2_/Q : # {110111}101 pat5 U_TOP_LOGIC/i_reg_2_/Q : # {110111}110 pat1 U_TOP_LOGIC/i_reg_3_/Q : # {111111}110 pat2 U_TOP_LOGIC/i_reg_3_/Q : # {111111}111 pat3 U_TOP_LOGIC/i_reg_3_/Q : # {111111}101 pat4 U_TOP_LOGIC/i_reg_3_/Q : # {111111}110 pat5 U_TOP_LOGIC/i_reg_3_/Q : # {111111}111 pat1 U_TOP_LOGIC/i_reg_4_/Q : # {111111}111 pat2 U_TOP_LOGIC/i_reg_4_/Q : # {111111}011 pat3 U_TOP_LOGIC/i_reg_4_/Q : # {111111}111 pat4 U_TOP_LOGIC/i_reg_4_/Q : # {111111}011 pat5 U_TOP_LOGIC/i_reg_4_/Q : # {111111}111 ################################################################
As you can see in the input file there are 5 patterns for each register .
Please find the output file which I am looking for .In this output file first section is the name of the register(should come only once) , then the patterns name pat1 pat2 pat3 pat4 and pat5 , Each of this pattern should have a value which is the first split from the section
For example {111111}111
I am just looking for the first value after finishing of curly braces.'
{111111} - dont want this
111 - 1st value from this pattern ie 1
Example : U_TOP_LOGIC/i_reg_2_/Q , The first value after the curly braces for each pattern is 1 1 0 1 1 .
Output file (First split)
######################################################## Reg pat1 pat2 pat3 pat4 pat5 ######################################################## U_TOP_LOGIC/i_reg_2_/Q 1 1 0 1 1 U_TOP_LOGIC/i_reg_3_/Q 1 1 1 1 1 U_TOP_LOGIC/i_reg_4_/Q 1 0 1 0 1 ########################################################
I am not getting exact success with perl . Could you help me out?
Thanks and Regards
Kshitij Kulshreshtha
|
|---|