How to remove extra row from build data table activity

Hi,

How can i remove extra row from Build datatble activity. Due to this an empty row is getting added.

Remove row button doen’t work.

Regards,
Vishal.

@Vishal_Kumar4

just click on x mark at the left…and it would be removed

one row by default would be seen but click on x any data will be cleared and no row gets added

cheers

This removee row button does nothing.

Regards,
Vishal

@Vishal_Kumar4,

If it’s gray colure it means it’s not going to add blank row to your datatable.

You can test it by checking it in immediate window while debugging like this:

dtVariable.RowCount

Thanks,
Ashok :slight_smile:

dtVaraible.RowCount is coming 0. But when i am using write csv and then append line on the same csv file. I am getting blank row between datatable and append line data.

image

image

Regards,
Vishal

Hi @Vishal_Kumar4,

After appending all the rows finally remove the blank rows using filter datatable activity.

@Vishal_Kumar4

Then the issue is with cav file…check on the cav there is a line already remove that

To confirm use write csv instead of append

Cheers

The Csv file is fresh and new.
I am already using the write csv to add the table header which comes from build data table activity.
After that I am using append line activity to further add data to the same.

Will do this as last option.

@Vishal_Kumar4,

You are using incorrect activity. Whatever data you want to append/write to the csv, build it into a datatable then use Append to CSV activity.

Output:
image

Thanks,
Ashok :slight_smile:

Values are coming from variable. So cannot use it in build datatable activity. Also, append line is easier to use for this scenario. Obviously there are multiple ways to resolve this.

Just trying to understand why extra row is added.

Regards,
Vishal

Use Add Data Row activity.

Thanks,
Ashok :slight_smile:

As i said, It can be done in multiple ways. I am trying to understand why extra row comes. And how to delete it from build datatable activity.

Regards,
Vishal.

@Vishal_Kumar4,

It’s being added by append line activity. It’s in it’s name that it’s going to add line to the existing text on new or next line.

CSV file considers that line break as blank row that’s why it’s reflecting as blank row.

It’s not issue of Build datatable.

This is the reason.

Thanks,
Ashok :slight_smile:

It can be done multiple ways, but there is only one correct way that will fix your problem. You were told why the problem is happening and how to correct it. The extra row IS NOT coming from the Build activity. How about trying the advice you’ve been given?

The empty line is added by the the Write CSV activity. You can easily see it by running the activity by itself and then open the csv file in a text editor:

image

There’re one row with the headers and an empty row. The Append to CSV activity will take this into consideration but the Append Line doesn’t. It will just append a new line below the empty row.

So either use Write CSV with Append to CSV or use Write Text File with Append Line instead.

String.Join(“,”, dtHeaders.Columns.Cast(of DataColumn).Select(Function(c) c.ColumnName))

image

image

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