How to segregate the data line by line

I have below mention data

Ex:

Bala
4,satha st,
gobi
erode .
tamilnadu
robotic process automation-UiPath

I want to segregate the above data line by line and need to excel.

Split(yourVar,VbCrLf)

This will give you an array with one element for each line.

@BNK

Hello ,

linesArray = inputText.Split({Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)

Hi @BNK

Can you try this

image

Final.xlsx (6.2 KB)

Cheers!!

I want to write column by column

@BNK

Can you please provide output what you want

Hi @BNK

→ Read Text File


Output-> str_Text
→ Build DataTable
image
Output-> dt_Output
→ use below syntax in Assign:

dt_Output= (From line In str_Text.Split({Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries) Select dt_Output.Rows.Add(line)).CopyToDataTable()

dt_Output datatype System.Data.DataTable
→ Write Range Workbook


Sequence11.xaml (9.7 KB)

Regards

Expected output

expected output

Hi @BNK
→ Read Text File


Output->str_text
→ Use the below syntax in Assign:

lines= str_Text.Split({Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries)

lines is of Array(System.String)
→ Use below syntax in assign:

Output= String.Join("/",lines)

Output is of DataType System.String
→ Generate DataTable from Text


→ Write Range Workbook

Sequence11.xaml (11.2 KB)

Regards

@BNK

How about the following?

Input.Split({vbCrLf, vbLf}, StringSplitOptions.RemoveEmptyEntries)

Final.xlsx (6.1 KB)

Sequence1.xaml (12.9 KB)

Cheers!!

1 Like

I have all the input data in excel.
Pleas check the attached
Output - Copy.xlsx (7.9 KB)
excel

expected output

image

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