Copiying column values from one sheet to another

Hi,

i am trying to populate column values from one excel sheet to another by comparing column
name which read from pdf

Pdf

from pdf the bot will extract “Name of Person” using Regex
then using that variable the bot will search column name in sheet1 to match that variable value

if it match then the bot pull all data from that column and populate it on sheet 2

Here bot throwing some error like this

i this variable is not supporting in this method

Can someone help me

@jai_kumar2 , try this .Trim at the end of variable. Space may affect the results

For example: NameOfCanditate.trim

Hi @jai_kumar2

Copy from one sheet to another, checkout the below activity.

Have a look on the video

Regards
Gokul

Hey!

Try like this…

  1. Build data table - create the output columns like Name,Age,Work,Qualification - Output as DtOut

  2. Use this Regex to pull out the name

Assign strName = System.Text.RegularExpressions.Regex.Match(StrInput,"(?<=Name:).*").ToString

Age:

Assign strAge = System.Text.RegularExpressions.Regex.Match(StrInput,"(?<=Age:).*").ToString

Work:

Assign strwork = System.Text.RegularExpressions.Regex.Match(StrInput,"(?<=Work:).*").ToString

Qualification:

Assign strQualification = System.Text.RegularExpressions.Regex.Match(StrInput,"(?<=Qualification:).*").ToString

Now use ADD DATA ROW activity and pass the ArrayOfRow like this

{strName,strAge,strWork,strQualification}

DataTable as DtOut

If you wants to write this to Excel use Write range ->Check Add Headers in the Properties panel-Data Table as DtOut

That’s it

Try this and let me know

Reards,
NaNi

Actually i removed space in variable value and in column by ("Replace " " to “”) replace space method still iam facing the error

@jai_kumar2 Try .trim , Because I felt Space at string. Try this, It may Help
image

Thank you so much it worked

@jai_kumar2 ,
Info: Try .trim maximum while using String. It will remove white space at Front and end of string, so you can get accurate value

Happy Automation :smile:

1 Like

But in my case have to remove space in between words like “Name of Person” to “NameOfPerson”

@jai_kumar2 Try this
image

System.Text.RegularExpressions.Regex.Replace(" Name Of Person “,” “,”").ToString.Trim

You can remove space at end as well as in between of Letter.

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