Hi,
There are probably better ways to do this, but now I'm getting frustrated because I can't get csplit to work and it should. (I hate it when things don't work and they should.)
I have a file that looks like this:
Searching DFDSFS
xxxx
xxxx
xxx
Searching SDFDFDS
ZZZZ
ZZZZ
etc
What I would like to do is create one file that contains the Search text for each section...For the above example I'd want 2 files one with :
Searching DFDSFS
xxxx
xxxx
xxx
and the other with :
Searching SDFDFDS
ZZZZ
ZZZZ
I've tried csplit a few different ways.
csplit -k -f cust. custcsmvpl '%Searching%' '{21}'
If the last parm is more than the number of "Searching"s in the file I get
"csplit: 0653-113 {23} is greater than the current line or the end of the file."
If it is less than the number of "Searching"s I get 1 file starting with the data at the nth "Searching".
What am I doing wrong?
Any help would be appreciated, Thanks, Leigh
There are probably better ways to do this, but now I'm getting frustrated because I can't get csplit to work and it should. (I hate it when things don't work and they should.)
I have a file that looks like this:
Searching DFDSFS
xxxx
xxxx
xxx
Searching SDFDFDS
ZZZZ
ZZZZ
etc
What I would like to do is create one file that contains the Search text for each section...For the above example I'd want 2 files one with :
Searching DFDSFS
xxxx
xxxx
xxx
and the other with :
Searching SDFDFDS
ZZZZ
ZZZZ
I've tried csplit a few different ways.
csplit -k -f cust. custcsmvpl '%Searching%' '{21}'
If the last parm is more than the number of "Searching"s in the file I get
"csplit: 0653-113 {23} is greater than the current line or the end of the file."
If it is less than the number of "Searching"s I get 1 file starting with the data at the nth "Searching".
What am I doing wrong?
Any help would be appreciated, Thanks, Leigh