How to extract words from a line of text

Good night friends:

Please I require your help is this problem:

How to extract the word “CAPSO DF” found in the second column, using regex, it has to be from the second column, because there are cases that the first column has the same name and in other cases, no?

I will give two days of example:

line 1

CAPSO|CAPSO DF|2021-04-06 00:00:00|X2899070N|CARLOS QUISPE||||2117271|ARG|\N|INSTALLMENT|\N|\N|\N|\N|\N|\N|\N|\N|\N|\N|0|\N|308|850|227.59|2765.09|0|0|0|\N|\N|INICIAL|0|0000-00-00|2021-05-25

Line 2

TUGHES|TUGHES|2021-12-31 00:00:00|44762256||Aquiles Raul Maldonado|||HPE2000040863|\N|\N|PREVENTIVA|NOT DELINQUENT|\N|Active|\N|\N|\N|Tramo 0|\N|\N|\N|0|2022-01-19|0|264|0|264|0|0|

Thanks a lot

@Lynx

String.Split("|"c)(1).ToString

This will help you to take always the 2nd place word

Hope this may help you

Thanks

1 Like

@Lynx

Check below for your reference

image

Hope this may help you

Thanks

1 Like

Hi @Srini84 ,

My main idea is to read the second line of the text files, then extract the second data from that line and with it rename the same file.

But I have same errors:

read seconf linea and rename txt.zip (59.5 KB)

@Lynx

If you check my previous post, That’s the sampleString.Split("|"c)(1).ToString

Because I stored the value in sampleString

So replace with your where the line is stored and use that expression

Hope this will help you

Thanks

Hi @Srini84 ,

My main idea is to read the second line of the text files, then extract the second data from that line and with it rename the same file.

But I have same errors:
read seconf linea and rename txt.zip (59.5 KB)

@Lynx

Check below

rectified.zip (4.0 KB)

Hope this help you

Thanks

Thank you very much!!

1 Like

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