Skip to main content

I have a text file file.txt contaning the following:

"random
textA"
"random
random
textB"

The separator is "

How can I split the containt into multiple file as follow using a bash command :?

File 1 :

random
textA

File 2 :

random
random
textB

I came into examples using csplit or awk but they does not cover this text layout.

I have a text file file.txt contaning the following:

"random
textA"
"random
random
textB"

The separator is "

How can I split the containt into multiple file as follow using bash command :

File 1 :

random
textA

File 2 :

random
random
textB

I came into examples using csplit or awk but they does not cover this text layout.

I have a text file contaning the following:

"random
textA"
"random
random
textB"

The separator is "

How can I split the containt into multiple file as follow using a bash command?

File 1 :

random
textA

File 2 :

random
random
textB

I came into examples using csplit or awk but they does not cover this text layout.

edited title; removed "thanks"; improved commands as code
Source Link

Split How to split text between separator into multiple files?

I have a text file file.txt contaning the following:

"random
textA"
"random
random
textB"

The separator is "

How can I split the containt into multiple file as follow using bash command :

File 1 :

random
textA

File 2 :

random
random
textB

I came into examples using csplitcsplit or awkawk but they does not cover this text layout.

Thank you for your help.

Split text between separator into multiple files

I have a text file file.txt contaning the following:

"random
textA"
"random
random
textB"

The separator is "

How can I split the containt into multiple file as follow using bash command :

File 1 :

random
textA

File 2 :

random
random
textB

I came into examples using csplit or awk but they does not cover this text layout.

Thank you for your help.

How to split text between separator into multiple files?

I have a text file file.txt contaning the following:

"random
textA"
"random
random
textB"

The separator is "

How can I split the containt into multiple file as follow using bash command :

File 1 :

random
textA

File 2 :

random
random
textB

I came into examples using csplit or awk but they does not cover this text layout.

Tweeted twitter.com/#!/StackUnix/status/542023889975775232
Source Link
Fabio
  • 83
  • 1
  • 1
  • 3

Split text between separator into multiple files

I have a text file file.txt contaning the following:

"random
textA"
"random
random
textB"

The separator is "

How can I split the containt into multiple file as follow using bash command :

File 1 :

random
textA

File 2 :

random
random
textB

I came into examples using csplit or awk but they does not cover this text layout.

Thank you for your help.