Excel extract specific set of words from a Column

Hi,

I have csv file with column of name and surname written in different maner. The picture is attached:
Excel3
Which activities should I use to leave only Name and Surname like this: NameSurname, without spaces?
Should I use Regular expressions? If so, what is experession?

Use regex for only words.

I saw that post, it is not clear. Any other ideas?

@Apple1

I think Regex for keeping only word characters before any other character is not what you are looking for

You can try using sub string and replace space. Refer below sample and attached file too.

row(0).ToString.Replace(" β€œ,”").Substring(0,v_strlen-4)Main.xaml (6.4 KB) .

Hope this helps…

1 Like

I used: System.Text.RegularExpressions.Regex.Match(row(0).ToString,”^[a-zA-Z]*”).ToString.Trim
but only β€œβ€ (nothing) got in result

Hi, if you wanna remove all spaces, try For each row & Assign like this.
Let me know if it works for you

Hi @Apple1

Below is the working String Manipulation for the same along with regex :-

Regex.Replace(row(0).ToString.Trim,"\s+"," ").Split(" "c)(0)+Regex.Replace(row(0).ToString.Trim,"\s+"," ").Split(" "c)(1)

Below is the workflow for the same :-
MainPratik.xaml (9.7 KB)
Apple.xlsx (8.3 KB)

Output :-
image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

Hi @Pratik_Wavhal,

Thanl you for your responce, your suggestion worked for me.
Now I need all new rows from variable to be added to new excel table. I attached picture of process I created. In the resulst I get excel file that contains only 1 row, meaning that each new row from variable containing regular experession just overwrited in first row of excel file. How can I keep all rows in my new excel file?

@Pratik_Wavhal
Picture of process

Hi @tranthao240495,

Thank you for your responce. Solution of @Pratik_Wavhal worked for me.

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