There is a file AA.TXT as follows:
FGAFFFFSFF
GGFDGG
R*01
FSFF
HHH
R*02
FSDGF
HDFH
GHGH
JJHGJR
R*03
....
kljljfljfkj
fmlfk
R*n
How to split the file according to the R* mark, and name it according to the characters after *? That is: 01.txt content is
01.txt
FGAFFFFSFF
GGFDGG
02.txt content is
02.txt
FSFF
HHH
03.txt content is
03.txt
FSDGF
HDFH
GHGH
JJHGJR
.....
n.txtcontent is
n.txt
kljljfljfkj
fmlfk
In actual situations, the file AA.TXT to be split may be very large, and efficiency of splitting must be considered
Thank you各位 predecessors in advance here
FGAFFFFSFF
GGFDGG
R*01
FSFF
HHH
R*02
FSDGF
HDFH
GHGH
JJHGJR
R*03
....
kljljfljfkj
fmlfk
R*n
How to split the file according to the R* mark, and name it according to the characters after *? That is: 01.txt content is
01.txt
FGAFFFFSFF
GGFDGG
02.txt content is
02.txt
FSFF
HHH
03.txt content is
03.txt
FSDGF
HDFH
GHGH
JJHGJR
.....
n.txtcontent is
n.txt
kljljfljfkj
fmlfk
In actual situations, the file AA.TXT to be split may be very large, and efficiency of splitting must be considered
Thank you各位 predecessors in advance here

DigestI