{"id":429,"date":"2014-03-12T05:12:58","date_gmt":"2014-03-12T05:12:58","guid":{"rendered":"http:\/\/codethataint.com\/blog\/?p=429"},"modified":"2014-03-12T05:30:40","modified_gmt":"2014-03-12T05:30:40","slug":"how-to-replicte-column-in-excel-sheet-jython","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/how-to-replicte-column-in-excel-sheet-jython\/","title":{"rendered":"How to Replicte Column in Excel Sheet Jython Scripting"},"content":{"rendered":"<p>I am having single column in excel sheet which I want to replicate in Jython scripting and place it in adjacent column.The Content of the Column is as in the Pic below<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\nfrom jxl import *\r\nfrom jxl.write import *\r\nfrom java.io import File\r\nworkbook = Workbook.getWorkbook(File(&quot;$(TargetFolder)\\Book2.xls&quot;))\r\ntargetWorkbook = Workbook.createWorkbook(File(&quot;$(TargetFolder)\\Book2.xls&quot;),\r\nworkbook)\r\nsheet = targetWorkbook.getSheet(0)\r\ncolumnIndex = 0\r\n\r\nrowCount = sheet.getRows()\r\n\r\nfor i in range(rowCount):\r\n row = sheet.getRow(i)\r\n content = row&#x5B;columnIndex].getContents()\r\n rc.logMessage(&quot;Content -&gt; &quot; + content)    \r\n wc = sheet.getWritableCell(1,i)\r\n newLabel = Label(1,i, content)\r\n sheet.addCell(newLabel)\r\n \r\ntargetWorkbook.write() \r\ntargetWorkbook.close()\r\nworkbook.close()\r\n<\/pre>\n<p>Before running Script<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codethataint.com\/blog\/wp-content\/uploads\/2014\/03\/ColumnReplica2.png\" alt=\"null\" width=\"184\" height=\"151\"\/><\/p>\n<p>After running Script<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codethataint.com\/blog\/wp-content\/uploads\/2014\/03\/ColumnReplica1.png\" alt=\"null\" width=\"180\" height=\"166\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am having single column in excel sheet which I want to replicate in Jython scripting and place it in adjacent column.The Content of the Column is as in the Pic below from jxl import * from jxl.write import * from java.io import File workbook = Workbook.getWorkbook(File(&quot;$(TargetFolder)\\Book2.xls&quot;)) targetWorkbook = Workbook.createWorkbook(File(&quot;$(TargetFolder)\\Book2.xls&quot;), workbook) sheet = targetWorkbook.getSheet(0) columnIndex&hellip; <a href=\"https:\/\/codethataint.com\/blog\/how-to-replicte-column-in-excel-sheet-jython\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,68],"tags":[],"class_list":["post-429","post","type-post","status-publish","format-standard","hentry","category-file-handling-jython","category-jython"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=429"}],"version-history":[{"count":7,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/429\/revisions"}],"predecessor-version":[{"id":438,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/429\/revisions\/438"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}