How to delete a headers if there is no headers in another excel and it should be converted to csv file

hi experts,
i am new to uipath
how to convert normal excel file to csv file and if there is no headers in normal file it should not print anything if there is headers it should print only the headers and it should be done with uipath studio
. For example i will send the screenshot for your reference


so please give me the solution experts
Thanks in advance

Hey!

Follow the steps below:

  1. Take one read range Activity from Workbook->Uncheck the headers in properties->Output as → Dt_Out

  2. Take one write CSV activity and provide the Dt_Out

Regards,
NaNi


i have done but it shows same i dont want the headers or columns if it is not there by reading the excel file @THIRU_NANI

Hey!

Try this

Regards,
NaNi

i have already checked @THIRU_NANI

it goes of all the headers which i want also sir @THIRU_NANI

Hey!

Check this out:

ExcelToCsv.7z (50.0 KB)

Try this as well:

Regards,
NaNi

Hi @sunil.kumar.s.v ,

Maybe to be more clear, If the Screenshot provided by you is the input data, Could you also provide the Screenshot of your Expected Output?

This way we can avoid further confusions and get to the solution faster.

hi @supermanPunch

wait i will provide the screeshort

reading from normal file :point_down: :point_down:


the code is :point_down: :point_down:

if i run the code present out it shows like this :point_down: :point_down: in csv extension

the expected output should be like this :point_down: :point_down:in csv extension

thanks in advance
reagrds
@supermanPunch

@sunil.kumar.s.v ,

I would suggest you to perform a Debug and check the Datatable value after Read Range Activity. This way we can understand if there is a blank column in Datatable.

Also, Is there an Absolute need for a Blank Column to Exist with Other Columns or can we remove the blank columns ?

it is absolute need for blank columns in future so it is important
@supermanPunch

i have done the debug mode and looked into it but there is no change @supermanPunch

@sunil.kumar.s.v ,Please try don’t keep “Add Headers” in both Read Range Activity and Write CSV Activity.
Or don’t keep “Include Headers” in Write CSV Activity.

if we dont keep the include headers automatically it will pop in “add headers” also
@HuaiYe

@supermanPunch ,Yep,but my csv file the column format you want.Please see the screenshot.
20220630145416

send me the code i will try it in my uipath @HuaiYe

Sequence.xaml (5.2 KB)
Test.xlsx (8.8 KB)
@supermanPunch ,you can try it.

1 Like

thank u let me check and let you know @HuaiYe

Ok,wait for u.

thank you so much for sending me the solution and hopefully its working
@HuaiYe

1 Like