How to Split data in .txt file into several .txt files automatically?

  1. Read Text File Scrip.txt

  2. Split the complete string by Device Name
    Example: QOAGTMSS02 (Device Name)

  3. Create Text files for each Device

Explanation:
Script File have 3 devices
1. QOAGTMSS02
2. QOAGTMGW
3. SCCGTMSS01

So, Robot have to create 3 Separate files with the file name as device name as below

1. QOAGTMSS02.txt
2. QOAGTMGW.txt
3. SCCGTMSS01.txt

Each file have to contain the respective data as per the device name.

Hi,
will the device name “QOAGTMSS02” has any prefix or it follows any default format.In that case we can try regex and split the data into 3 different groups.
It would be easy if you provide the entire text content

hi,
At the beginnng of every device name, there are two slashes(//)…

Thanks in advance

Hi @Mounikabade

if it is in this format like

//1.QOAGTMSS02

check this in regex

(?<=…).*

with the help of matches activity
Thanks
Ashwin S

Hi,
Assume the data is in the below format


//1.QOAGTMSS02
This is the basic
data
given here
//1.QOAGTMSTO4
Assuming the same here tooo


This regex will return all the content in the matches (//[^/]*)
which you can loop and do the string manipulations.