Trim the Excel row content

Here print only the file name , in the second row the output must be the second screenshot can anyone suggest me how to do?
I want to trim only the file name


@aman_sheik , please help
Thanks in advance.

@jyothi_M.B,

Here are few steps :

  1. Read the excel and store the data in datatable
  2. use for each row to iterate through the rows and within that, use row("text).tostring and you will get the column A value
  3. Split it as below and save it in another variable
    columnA_Value.split("\").Last()
  4. Use write cell activity to write it in column B.
  5. For dynamic range, declare a variable as count and increment its value by 1 inside the for each and give the range in write cell as in the screenshot …

image

Use Read Range Activity to read the data from “A2:A12” (fixed, else give A:A)

Declare one variable intCounter = 1

For each row in DataTable
intCounter = intCounter + 1
//use the following activity to get the file name only
pass row(0).ToString as input to the below activity


Write Cell activity to write the filename, Value = Output of above activity ; address = "B" + intCounter.ToString

@jyothi_M.B Please follow below steps.

  1. Read the excel file and store the output in datatable variable.
  2. Use For each datarow
    i) Inside for each use assign activity with below statements
    row(1)=path.GetFileName(row(0).ToString.Trim)
    Note: If 2nd column is not present in datatable add before for each.
  3. Finally write back datatable to excel.

@jyothi_M.B

Here is the steps!!!

Thanks
Aman SheikI