I want to concatenate two columns is excel and make it as a single column.
For example : column A=12 column B=778
The output should be column c=12778
please find the sample file in the attachment.
I want to concatenate two columns is excel and make it as a single column.
For example : column A=12 column B=778
The output should be column c=12778
please find the sample file in the attachment.
Well you can use the xlwings package for this.
import xlwings as xw
sht = xw.apps[0].books[0].sheets[0]
sht.range('C1').value = int(str(sht.range('A1').options(numbers=int).value) + str(sht.range('B1').options(numbers=int).value))
This snippet will connect to the first active excel application's first worksheet on your system, then grabs the numeric values from cells A1 and B1, convert them to integers then to strings and concatenate them, and finally reconvert it to an integer and pass the final value to cell C1.
For further reference please visit the package documentation.
Hope it helps.