Read txt file and Split Each Row

Need to Read a txt file with 50K Records, Read each row and extract desired output such as Value 1 = 1 and Value 2 = Abby.

Input = Text File with 50K Rows
Sample Row Eg = 1~Abby~null~1~1~0~2009-10-27 05:00:00~2018-07-02 16:06:22~2023-09-06 12:40:03~2018-07-02 16:06:22~2009-10-28 01:13:34~
Value 1 =1
Value 2 = Abby

Thanks in advance


Hope it Helps!!

Hi @prerna.gupta ,
Have you try read text file to get String then generate data table
use regex with each row,
can you share image about your file?


use match collection in regex so that you will all the rows values


1 Like

File Snipet

Tried this one but not working.

TestFile.txt (597 Bytes)

by this you will get all the matches collection.

splitting the desired values

H! @prerna.gupta

You can try this xaml
practice task 4.xaml (11.5 KB)

you can see the output

Can you pls share Snapshot of xml code ?
Multiple lib and VB error while opening this one.

NOT working for me. can you share the snapshot of code as well ?

1 Like

@prerna.gupta (2.8 KB)

check this

1 Like

Take assign activity and create a variable
str_input= β€œYourText”

And pass in for each and give the condition like this = str_input.Split({vbLf},StringSplitOptions.RemoveEmptyEntries)

for value 1

for value 2

Thanks much this is working as expected.

1 Like

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