jumdesumit has asked for the wisdom of the Perl Monks concerning the following question:

Hello everyone, I want to do Perl coding for Transistors counting of the Cells which are represented in one file(cell_report.docx) and the data of the transistor count of the cell is in the Excel sheet.I want to count the total transistors used in all the cells and put it in the data file in front of total cells. For example,

1. given in following file "Total 123 cells" "Total 850 transistors".

2.Cells= AN2X1,AN2B1XLP,OAI222X1

3.LOGIC= data from Excel Sheet and Want to rewrite(Total transitor count ) in this cell report

AN2X1 8

OAI222X1 24

Total cells 123 Total Count= 32

"cell_report.docx" Attributes: BO - reference allows boundary optimization b - black box (unknown) h - hierarchical n - noncombinational r - removable u - contains unmapped logic Cell Reference Library Area At +tributes ---------------------------------------------------------------------- +---------- U108 AN2X1 fsd0a_a_generic_core_tt1v25c 3.920000 U109 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U110 OAI222X1 fsd0a_a_generic_core_tt1v25c 7.840000 U111 OAI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U112 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U113 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U114 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U115 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U116 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U117 NR2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U118 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U119 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U120 AOI12X1 fsd0a_a_generic_core_tt1v25c 4.704000 U121 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U122 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U123 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U124 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U125 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U126 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U127 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U128 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U129 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U130 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U131 OAI122X1 fsd0a_a_generic_core_tt1v25c 7.056000 U132 AOI222X1 fsd0a_a_generic_core_tt1v25c 7.840000 U133 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U134 OAI122X1 fsd0a_a_generic_core_tt1v25c 7.056000 U135 AOI222X1 fsd0a_a_generic_core_tt1v25c 7.840000 U136 OAI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U137 OAI122X1 fsd0a_a_generic_core_tt1v25c 7.056000 U138 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U139 AOI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U140 ND3X1 fsd0a_a_generic_core_tt1v25c 4.704000 U141 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U142 OAI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U143 OAI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U144 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U145 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U146 OAI112X1 fsd0a_a_generic_core_tt1v25c 4.704000 U147 AOI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U148 AOI112X1 fsd0a_a_generic_core_tt1v25c 4.704000 U149 AOI13X1 fsd0a_a_generic_core_tt1v25c 5.488000 U150 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U151 OAI112X1 fsd0a_a_generic_core_tt1v25c 4.704000 U152 OA22X1 fsd0a_a_generic_core_tt1v25c 7.056000 U153 AOI222X1 fsd0a_a_generic_core_tt1v25c 7.840000 U154 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U155 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U156 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U157 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U158 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U159 NR2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U160 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U161 OR4B2XLP fsd0a_a_generic_core_tt1v25c 5.488000 U162 AOI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U163 AOI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U164 OAI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U165 OR4B2XLP fsd0a_a_generic_core_tt1v25c 5.488000 U166 OA222X1 fsd0a_a_generic_core_tt1v25c 9.408000 U167 AOI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U168 MOAI1X1 fsd0a_a_generic_core_tt1v25c 7.056000 U169 OAI23X1 fsd0a_a_generic_core_tt1v25c 6.272000 U170 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U171 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U172 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U173 NR2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U174 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U175 OAI22X1 fsd0a_a_generic_core_tt1v25c 5.488000 U176 OA12X1 fsd0a_a_generic_core_tt1v25c 5.488000 U177 ND3X1 fsd0a_a_generic_core_tt1v25c 4.704000 U178 OR4B2XLP fsd0a_a_generic_core_tt1v25c 5.488000 U179 ND3X1 fsd0a_a_generic_core_tt1v25c 4.704000 U180 AN4B1XLP fsd0a_a_generic_core_tt1v25c 5.488000 U181 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U182 NR2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U183 NR2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U184 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U185 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U186 NR2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U187 XOR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U188 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U189 AN2B1XLP fsd0a_a_generic_core_tt1v25c 3.920000 U190 AN4B2X1 fsd0a_a_generic_core_tt1v25c 5.488000 U191 XNR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U192 XOR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U193 XOR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U194 XOR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U195 XNR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U196 XNR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U197 AN4B2X1 fsd0a_a_generic_core_tt1v25c 5.488000 U198 XOR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U199 ND3X1 fsd0a_a_generic_core_tt1v25c 4.704000 U200 NR3X1 fsd0a_a_generic_core_tt1v25c 4.704000 U201 XNR2X1 fsd0a_a_generic_core_tt1v25c 7.840000 U202 OR4B2XLP fsd0a_a_generic_core_tt1v25c 5.488000 U203 ND2X1 fsd0a_a_generic_core_tt1v25c 3.136000 U204 ND3X1 fsd0a_a_generic_core_tt1v25c 4.704000 U205 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U206 INVX1 fsd0a_a_generic_core_tt1v25c 2.352000 U207 TIE1X1 fsd0a_a_generic_core_tt1v25c 2.352000 add_28 top_count_9_1_DW01_inc_0 108.976003 BO +, h bin_reg[0] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[1] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[2] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[3] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[4] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[5] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[6] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[7] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n bin_reg[8] QDFFX1 fsd0a_a_generic_core_tt1v25c 13.328000 n tmp_reg[0] QDFCLRBX1 fsd0a_a_generic_core_tt1v25c 19.600000 n tmp_reg[1] QDFCLRBX1 fsd0a_a_generic_core_tt1v25c 19.600000 n tmp_reg[2] QDFCLRBX1 fsd0a_a_generic_core_tt1v25c 19.600000 n tmp_reg[3] QDFCLRBX1 fsd0a_a_generic_core_tt1v25c 19.600000 n y_reg[0] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[1] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[2] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[3] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[4] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[5] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[6] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[7] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n y_reg[8] QDLAHX1 fsd0a_a_generic_core_tt1v25c 10.192000 n ---------------------------------------------------------------------- +---------- Total 123 cells 858.480010 1
"Transiotr_count.xlsx" Cells Transisitor count OR2X1 6 OAI23X1 18 NR3X1 6 ND2X1 4 AOI12X1 10 NR2X1 4 XOR2X1 4 INVX1 2 OR2B1XLP 8 NR2X1 4 XOR2X1 4 OAI22X1 16 INVX1 2 TIE1X1 2 QDFFX1 8 QDLAHX1 8 QDFCLRBX1 8 AN2B1XLP 8 OAI222X1 24 AOI12X1 16 AOI33X1 20 XNR2X1 4 OAI12X1 10 AOI23X1 18 AN4B1XLP 12 OA22X1 18 OR4B2XLP 14 OR3B2X1 12 HA1X1 16 MUX4X1 22 AO222X1 26 AOI22X1 16 OAI112X1 12 MOAI1X1 14 AO12X1 12 MUX2X1 12 MXL2XLP 8 MXL4XLP 30 BUFX1 4 MUX3X1 18 OA12X1 12 AO22X1 18 AOI222X1 24 AOI13X1 12 OAI122X1 18 OA222X1 26

Replies are listed 'Best First'.
Re: Transistor Counting from Excel Sheet.
by hippo (Archbishop) on Feb 05, 2018 at 15:00 UTC
    I want to do Perl coding for (detailed spec of some task)

    Great. Perl is probably a good choice for this. Here's how to proceed:

    1. Design an algorithm to fit the specification.
    2. Write Perl code to implement the algorithm.
    3. Write a test suite against the specification to prove that it has been met. (Once you become more proficient at this it is advisable to write the tests before the implementation.)
    4. If the test suite fails, go back to point 1 or 2 as appropriate.
    5. Document everything.

    Good luck with your project.

      Incomplete list.

      0. Try to find a fool that does your work for you.

      should not be missing.

      Nothing lost if it does not work, but just imagine it does...

        That's a great suggestion.Thanks for that. I am not very Much good at coding skills.So I had asked for help nothing more than that.

      Thanks a lot. I'll try my best.

Re: Transistor Counting from Excel Sheet.
by roboticus (Chancellor) on Feb 06, 2018 at 08:56 UTC

    jumdesumit:

    I'd suggest installing Spreadsheet::ParseExcel on your machine, and reviewing the example code and/or test code to see how to read from the spreadsheet.

    From there it's a simple matter to gather the data and compute the counts you're wanting.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.

      I don't think Spreadsheet::ParseExcel will work, because jumdesumit refers to an xlsx file (Transiotr_count.xlsx) and the description of Spreadsheet::ParseExcel says:
      "The module cannot read files in the Excel 2007 Open XML XLSX format. See the Spreadsheet::XLSX module instead."

      The "fun" bit might be reading the docx files (e.g. cell_report.docx), since there may be no modules which support the docx format, but pryrt's links above about docx may help.
      However, I've just tried this code for Windows (which uses Win32::OLE & Win32::OLE::Enum) and it successfully read my simple .doc and .docx files!  I wonder if there's a Linux alternative.

        tel2:

        That's a good point! I still suggest reading the examples from Spreadsheet::ParseExcel, but you're right that he'll want to use Spreadsheet::XLSX for his project, or one of the native Win::OLE ones.

        ...roboticus

        When your only tool is a hammer, all problems look like your thumb.