Help with String/document manipulation

I have a text file that contains a header row and other data rows that together, it is considered as one object of an event. The text file is as below:

$24;post;B;20231024;azb
z;99021063662;INM1;OzT zMS GAME;
z;99021063662;PPzP;9111;
z;99021063662;zzp;my name;
z;99021063662;dda;1123456786;
z;99021063662;zONF;N;
z;99021063662;aus;545K;

Screenshot of the record object ;
image

I have a business need to ::

  1. Read this file.
    2.Supply a value to an int variable(numberOfObjectsNeeded) -This is the number of separate objects that will be created based on the sample object above. For example, if numberOfObjectsNeeded = 2, the workflow will write a text file that contains 2 object.
  2. Each object has to be different from the previous one.
    There are two rules that applies here:
    a. The objects will be different from each other by manipulating any of the first three numbers of the first field (i.e 99021063662 may now become 99121063662, 99221063662,99121063662). As long as only the first three numbers are not the same ,and the length of total length is not more than 11, its fine.
    b. The same header row is inserted at the beginning of each object. For example, this file has 2 objects:
    $24;post;B;20231024;azb
    z;99021063662;INM1;OzT zMS GAME;
    z;99021063662;PPzP;9111;
    z;99021063662;zzp;my name;
    z;99021063662;dda;1123456786;
    z;99021063662;zONF;N;
    z;99021063662;aus;545K;
    $24;post;B;20231024;azb
    z;99121063662;INM1;OzT zMS GAME;
    z;99121063662;PPzP;9111;
    z;99121063662;zzp;my name;
    z;99121063662;dda;1123456786;
    z;99121063662;zONF;N;
    z;99121063662;aus;545K;

Screenshot of the file with the 2 objects;
objectStructure

The automation should be able to generate up to 400 distinct objects from that one object.

Any help will be GREATLY appreciated because this task seems big , I don’t mind the workflow

Hi @Yomi_Oluwadara ,
You can use attached workflow
CreateEventText.xaml (9.9 KB)

image
@AMAN_GUPTA Thanks, is this a Find matching pattern activity? ?Maybe I need some dependencies because it load on my windows version of UiPath

Hi @Yomi_Oluwadara

Right click on dependency in Project panel then click on Repair dependency

@AMAN_GUPTA I tried to repair the dependency at the top level earlier, but it puzzles me that I don’t have that option. I also tried to see if I can repair dependency at the lower/folder level, but still did not have that option.

NOt sure if this helps, but I’m using a licensed version of UiPath- maybe my version does not have the activity?

@lrtetala @AMAN_GUPTA
Could you kindly send me the content of the variables in the properties panel? the pattern variable and others

@Yomi_Oluwadara

1 Like

@AMAN_GUPTA
Thanks for sharing that, however, my attached workflow is currently removing the first three digits, that is 990 was removed from 99021063662 which is fine.

The business rule is that once 990 is removed, it should be replaced by any random 3 digits.
And then we add the other remaining digits(21063662) when forming
the objects. We only want to replace the first 3 digits. So for example from my current workflow that is attached, the output seen below

$24;post;B;20231024;azb
z;99021063662;INM1;OzT zMS GAME;
z;99021063662;PPzP;9111;
z;99021063662;zzp;my name;
z;99021063662;dda;1123456786;
z;99021063662;zONF;N;
z;99021063662;aus;545K;
$24;post;B;20231024;azb
z;002;INM1;OzT zMS GAME;
z;002;PPzP;9111;
z;002;zzp;my name;
z;002;dda;1123456786;
z;002;zONF;N;
z;002;aus;545K;
$24;post;B;20231024;azb
z;001;INM1;OzT zMS GAME;
z;001;PPzP;9111;
z;001;zzp;my name;
z;001;dda;1123456786;
z;001;zONF;N;

should have been

$24;post;B;20231024;azb
z;99021063662;INM1;OzT zMS GAME;
z;99021063662;PPzP;9111;
z;99021063662;zzp;my name;
z;99021063662;dda;1123456786;
z;99021063662;zONF;N;
z;99021063662;aus;545K;
$24;post;B;20231024;azb
z;00221063662;INM1;OzT zMS GAME;
z;00221063662;PPzP;9111;
z;00221063662;zzp;my name;
z;00221063662;dda;1123456786;
z;00221063662;zONF;N;
z;00221063662;aus;545K;
$24;post;B;20231024;azb
z;00121063662;INM1;OzT zMS GAME;
z;00121063662;PPzP;9111;
z;00121063662;zzp;my name;
z;00121063662;dda;1123456786;
z;00121063662;zONF;N;


manipulateFirstThreeDigits.zip (3.7 KB)

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