Home > other >  Shell split files according to the specified content
Shell split files according to the specified content

Time:11-17

1. In a XXX. TXT file there are a number of the create table, according to the create table will now this XXX. TXT into table name. TXT, the table name is behind the create table name,

CodePudding user response:

Please refer to the
Describe the factors clearly, Python beginners small white common errors and problems
Clarify the problem, the best output plus sample and hope

CodePudding user response:

Quote: refer to the second floor crifan response:

please referenceDescribe the factors clearly, Python beginners small white common errors and problems
Clarify problems, combined with the sample and best hope output

[redhat @ localhost shell] $cat drop_table. TXT
Drop table aaa
The create table...
;
Drop table BBB
The create table...
;
Drop table CCC
The create table...

Want to achieve as a result of the output three files:
Aaa. TXT
BBB. TXT
CCC. TXT
One of the file content is: such as cat aaa. TXT
Drop table aaa
The create table...
;
Similarly a lot for the table scripts I will according to the name of the table split apart,
  • Related