I want to filter data from my excelsheet…
In the spreadsheet, every column “B” the value is something like “SC-519219-2019 Testing”.
I only want the first 16 character or get “SC-519219-2019”
I have attached a list of the spreadsheet i used
I’m learning how to automate please guide me i really want to learn and use this to show in my company to buy/use this…
You were almost done
—use excel application scope and pass the file path as input
—use a read range activity and get the output with a variable of type datatable named dt
—now use a for each row loop and pass the above datatable variable as input
—Inside then loop use a writeline activity like this row(“yourcolumnname”).ToString.SubString(0,16).ToString
Fine no worries
Kindly enable once the writeline activity and let it be active
I would like to see the output of it getting displayed in the output panel so that we would be able to find the string
May be in addition we could know the length as well also that we could validate the length been passed
Like this without any SubString in writeline activity row(1).ToString.Trim+” “+row(1).ToString.Length.ToString
Kindly share the screenshot of the value getting displayed in the output panel
May i know whats the next step ?
could i attach my current xaml and excel , and help me see how i could filter each row in column “B” to be character 16…
thank you for replying & helping
If possible can I have a view I the excel alone as a screenshot
I saw the attachment with this thread but it doesn’t look clear
Kindly take a screenshot of the excel opened and with records visible
We are almost done
I hope it must be row(0).ToString.SubString(0,16).ToString
But I would to make sure the structure of excel once
Give a try with this or no worries kindly share the excel screenshot please
Cheers @haziqh
@Palaniyappan any updates on how to finish it ?
basically writting the string of “row(0).ToString.SubString(0,15).ToString” instead of just putting it as writeline…
Fine
Hope these steps would help you resolve this
—use excel apply scope and pass the file path as input
—Inside the scope use a read range activity and get the output with a variable of type datatable named dt and make sure that ADD HEADERS property is unchecked
—now use a for each row loop and pass the above variable dt as input
—Inside the loop use a if condition like this row(0).ToString.Length >= 15
If this is true it will get into THEN part where we can have a assign activity like this row(0) = row(0).ToString.Trim.SubString(0,16)
Or
It will go to ELSE part where we can have a assign activity like this row(0) = row(0).ToString.Trim.SubString(0,15)
That’s all you are done
Hope this would help you
Cheers @haziqh