How to Split a String

Hi @Divakar_Sundaram,

strvalue= "How to use "" as a delimiter"

arrvalue=strvalue.split(""""c)

arrvalue(0).Tostring ->How to use

Regards,
Arivu

Hi arivu96,
thanks for the reply.
The case i have is as below
strvalue= How to use " as a delimiter"

Yes @Divakar_Sundaram, the string values is in between the double quotes right so i givien like that.

If you print the string value you will get the value as How to use " as a delimiter" only.

implement the logic.

Regards,
Arivu

1 Like

Hi @arivu96,

It helped to resolve my issue but i got an another case in the same. If am using this in case if the body contains any other numbers it’s giving those numbers as well.

For example I got a mail response like the below Mail in other words a response mail then the result for this is “2385927841620181021238592784” can you please help me to improve the Split function.

Thanks in Advance!!!

Mail Body:

Hi Team,

We have processed the whole application and got the PO number the current number is PO: 238592784.

Regards,
Prasanth

From: MailAddress
Sent: Wednesday, May 16, 2018 10:21 PM
To: MailAddress
Subject: Resultant OPO

Hi Team,

We have processed the whole application and got the PO number the current number is PO: 23859278.

Regards,
Prasanth

Hi @Prasanth_kolla, take a look at this .xaml, I hope it could help you.
test.xaml (6,8 KB)

Result
imagen

2 Likes

Hi Divya,

I need small help regarding converting data from PDF file to csv with the proper format.

Can i have any class file related to that.

When i try to run that script . the csv file has generated but the data is not in proper format.

if u want i will send the PDF file along with that class file and excel file also.

yes please attach the file i will look into it and will get back to you:)

HI Divya,

Please find the attached pdf file and excel file.

IN excel file given data as we need as same format of information displayed in pdf.

So we need to convert that pdf data in to csv file by using that information.

Thanks for your suppport in advance…

Participant_CMCLudhiana.pdf (793 KB)

FD_Data in Excel.xlsx (1.27 MB)

It seems UI Path uses the .Net framework and these standard functions don’t work as you expect them to do in Python for example. You can view their documentation here for split function: https://msdn.microsoft.com/en-us/library/system.string.split(v=vs.90).aspx

try using this PDFVariable.Split({“not”},StringSplitOptions.RemoveEmptyEntries)

thanks, it worked for me perfectly

Hi Divya,

   Could you please tell how to convert that pdf data in to csv file using string operations.

Thanks,
Prakash

Hi im new to UI path and i have a scenario where im reading text from pdf which returns in below format
agdhd
ahshd
ajdjhd
gghsfgs
nmju
Period First Day of Period Last Day of Period Airline Input Upload Cut-off CASS Reports Available Agent Corrections Query Cut-off Airline Correction Response Cut-off Correction Period - Reports Available Agent Remittance Date
201801 Mon 01-Jan-18 Mon 15-Jan-18 Tue 23-Jan-18 Thu 25-Jan-18 Tue 30-Jan-18 Fri 02-Feb-18 Sat 03-Feb-18 Mon 12-Feb-18
201802 Tue 16-Jan-18 Wed 31-Jan-18 Thu 08-Feb-18 Sat 10-Feb-18 Thu 15-Feb-18 Wed 21-Feb-18 Thu 22-Feb-18 Wed 28-Feb-18
201803 Thu 01-Feb-18 Thu 15-Feb-18 Fri 23-Feb-18 Sun 25-Feb-18 Thu 01-Mar-18 Tue 06-Mar-18 Wed 07-Mar-18 Thu 15-Mar-18
201804 Fri 16-Feb-18 Wed 28-Feb-18 Thu 08-Mar-18 Sat 10-Mar-18 Thu 15-Mar-18 Tue 20-Mar-18 Wed 21-Mar-18 Wed 28-Mar-18
201805 Thu 01-Mar-18 Thu 15-Mar-18 Fri 23-Mar-18 Sun 25-Mar-18 Thu 29-Mar-18 Wed 04-Apr-18 Thu 05-Apr-18 Thu 12-Apr-18
201806 Fri 16-Mar-18 Sat 31-Mar-18 Mon 09-Apr-18 Wed 11-Apr-18 Mon 16-Apr-18 Thu 19-Apr-18 Fri 20-Apr-18 Mon 30-Apr-18
201807 Sun 01-Apr-18 Sun 15-Apr-18 Mon 23-Apr-18 Wed 25-Apr-18 Mon 30-Apr-18 Fri 04-May-18 Sat 05-May-18 Mon 14-May-18
201808 Mon 16-Apr-18 Mon 30-Apr-18 Wed 09-May-18 Fri 11-May-18 Wed 16-May-18 Mon 21-May-18 Tue 22-May-18 Mon 28-May-18
201809 Tue 01-May-18 Tue 15-May-18 Wed 23-May-18 Fri 25-May-18 Thu 31-May-18 Tue 05-Jun-18 Wed 06-Jun-18 Tue 12-Jun-18
201810 Wed 16-May-18 Thu 31-May-18 Fri 08-Jun-18 Sun 10-Jun-18 Thu 14-Jun-18 Wed 20-Jun-18 Thu 21-Jun-18 Thu 28-Jun-18
201811 Fri 01-Jun-18 Fri 15-Jun-18 Mon 25-Jun-18 Wed 27-Jun-18 Mon 02-Jul-18 Thu 05-Jul-18 Fri 06-Jul-18 Fri 13-Jul-18
201812 Sat 16-Jun-18 Sat 30-Jun-18 Mon 09-Jul-18 Wed 11-Jul-18 Mon 16-Jul-18 Thu 19-Jul-18 Fri 20-Jul-18 Mon 30-Jul-18
201813 Sun 01-Jul-18 Sun 15-Jul-18 Mon 23-Jul-18 Wed 25-Jul-18 Mon 30-Jul-18 Thu 02-Aug-18 Fri 03-Aug-18 Mon 13-Aug-18
201814 Mon 16-Jul-18 Tue 31-Jul-18 Wed 08-Aug-18 Fri 10-Aug-18 Wed 15-Aug-18 Mon 20-Aug-18 Tue 21-Aug-18 Tue 28-Aug-18
201815 Wed 01-Aug-18 Wed 15-Aug-18 Fri 24-Aug-18 Sun 26-Aug-18 Thu 30-Aug-18 Tue 04-Sep-18 Wed 05-Sep-18 Wed 12-Sep-18

here i need to extract the data as a table structure using split string and write in data table… is that possible ??

Hi @sulbiyas,

For example
strText =" Period First Day o........."

1.Split based on the New line
arrline=strText.Split({Environment.Newline},StringSplitOptions.None)
2. Create the datatable
arrHeader=arrline(0).split(vbTab)
using for each add the column
3. Append the value to datatable
remaining (arrline) lines using for each split the data and append it into data table.
Note : First line is header remaining lines append it into datatable

4 Likes

Hi Divya,

Sorry to disturb you,Could you find any solution for this.As well am attached the files for reference purpose also.
We need Data in PDF, should display the same information in CSV

Hi everyone, I am trying to split this Generic Value:

green
red
yellow

What I need is:

green-red-yellow

Thank you!

Please find your xaml.
Main.xaml (7.3 KB)
output
image

2 Likes