Home > other >  Small white consult how to turn a file according to the semicolon generate multiple files
Small white consult how to turn a file according to the semicolon generate multiple files

Time:04-26

There are thousands of lines,
Need to be carried out in accordance with the semicolon cutting, and generate multiple files,
Better be named after the first line of the fifth field to file,
Help bosses give advice, thanks!

CodePudding user response:

 & gt;> A="11; 12. 13; 14. 15. 16 \ n21. 22. 23. 24. 25. 26 \ n 
">> B=a.s plit (' \ n ')
> B
[' 11, 12, 13, 14, 15, 16 ', '21, 22, 23, 24, 25, 26', ']
> C=b [0]. Split ('; ')
> C
[' 11 ', 12 ', 13 ', 14 ' ', '15', '16']
> C [4]
'15'
> C=b [1]. The split ('; ')
> C [4]
'25'
>
  • Related