Hello Everyone,
So, my scenario is to read an excel file and write that data into another excel with different column name.
Do you want to change only column names ? And also do you want to write all columns in the same order as it from original file ?
@Tushar_Gupta1 There possibly might be two ways of Performing it.
-
Having a Excel Template ready with Headers.
When using this Approach have an Excel File Ready with the Header Names present in it in the First row.
After that You can use Read Range Activity to Read the Data from the Excel file as a Datatable.
Then you can use Write Range Activity and specify the ExcelFile Path of the Template created. Use the Output Datatable of the Read Range as the Input for this Activity and UnCheck Add Headers. Specify the Range as âA2â.
It Should work. -
Changing the Column Names in Datatable.
You can Check this Workflow for that, but for this the Array of String used should contain the Names in the Order of the Datatable names that you want to replace with. Also the Array values Should have the same number of items as the number of Columns in the Datatable.
Change Column Names In Datatable.xaml (6.7 KB)
This is just a Template.
Also you can check with this Activity :
@supermanPunch and @lakshman Thanks for the reply but my scenerio is little bit differentâŚSo, I have two excel files in excel1 I have all the data with it header name and in excel2 i have only header name which is totally different from excel1 EXAMPLE in excel1 data is at Column No 4 and name is âCategoryâ so i want to enter that data into excel2 at Column No6 whose name is âAccounntsâ.
Hope this information will help you to resolve my problem
Can anyone help me out from this situation?
@Tushar_Gupta1 I think your Scenario is not about changing column Names then ,Can you please provide Sample Data and the Expected Output that you need. We may be able to understand better in that way .
Hi @Tushar_Gupta1,
Why donât use the copy past activities. like below.
- Copy the range as column like âA:Aâ
- Paste like
Regards
Balamurugan.S
So I want write âACT_CLIENT_VALUE_DATEâ Columnâs data to âTransaction Dateâ and so on.
@balupad14, sure Iâll try thisâŚ
@balupad14 Not WorkingâŚ
Check this video .
I have explained
- how to copy paste data inside excel using UiPath studio
- how to copy paste data one excel file to another excel file using UiPath studio
- how to convert the clipboard data to datatable.
Thank you
Balamurugan.S
@balupad14 Getting this error âException from HRESULT: 0x800A03ECâ, although i kill the process, after that Iâm getting this error.
can you share your workflow please âŚ
This is my FileMain.xaml (6.4 KB)
Hi,
The problem is the range for both activities.
- CopyTo Clipboardâs range should be like
- Paste Clipboardpâs range should be like
Thank you
Balamurugan.S
@balupad14 As you can see I donât want to copy header name from âMISâ and I want to write data After the header in âBRSâ, is this possible to do so?
Iâm getting the same error in paste clipboard, any suggestions?
Hi @Tushar_Gupta1,
- Use the find last row in sheet for the copy to clipboard
- you can specify range as âA1:A(last row index)â
-in the Paste to clipboard specify only âD4â.
Thank you
Balamurugan.S
@balupad14 ThankYou for the solutionâŚ
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.