Append Range to Achive Headers

Hi All

How to achive headers or any logic using append range.Im looping thru a lot of csv file and save the value of csv in Excel file and Add the Headers.

Thanks. :smiley:

4 Likes

Can you elaborate a bit please @pattyricarte?

You want to fill a particular range with some logic?

2 Likes

Hi @HareeshMR

If i where to use write range the value is overwriten but it has a header .Because i loop thru a lot of csv file and save it to excel.But if i use Append range it totally works but with out a header !

cheers :smiley:

Happy learning :smiley:

4 Likes

So, if all your CSV files have the same headers and if they are in the same columns, then read the first CSV with headers and remaining all , uncheck the headers @pattyricarte

But Iā€™m still confused with your explanation above :smile:

1 Like

hi @HareeshMR
Scenario:
1.First read all the csv file in a desired File Path.
2.After reading csv file i need to write it on excel file.

Note: If i use read range theres no option in putting the headers. But if i use Write range there has an option in putting some headers but if i use the Write Range it will over writen the value. Hope this make sense now.

image

Thanks :smiley:

6 Likes

Yeah @pattyricarte

Thank you for the patience :wink:

As you are reading a CSV file, you can have IncludeColumnNames check box to include column names or just the data. So, what Iā€™m trying to say is

  1. Read the first CSV with the check box checked and use write range activity so that the headers will be included in the excel
  2. from the second file onwards, uncheck it . so that it will rread only data and store in data table.
  3. when you use append range, it will append only data

You can do it in another way also @pattyricarte

  1. Do the first step above and write it to excel
  2. Find the count of rows in a data table using datatable.rows.count and then store it in a data table
  3. Then read the second excel and then read its row count then add the two data tables row count.
  4. Then while writing it in excel, give the range as ā€œAā€ + rowcount.tostring so that it will write after the existing data

Hope Iā€™m clear now

3 Likes

Thanks @HareeshMR it really helps

6 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.