regex - Looking for correct Regular Expression for csplit -
i have file contains several lines these:
1291126929200 started 88 videolist15.txt 4 4 1291126929250 59.875 29.0 29.580243595150186 43.016096916037604 1291126929296 59.921 29.0 29.52749417740926 42.78632483544682 1291126929359 59.984 29.0 29.479540161281143 42.56031951027556 1291126929437 60.046 50.0 31.345036510255586 42.682281485516945 1291126932859 started 88 videolist15.txt 5 4
i want split files every line contains started
(or videolist
, not matter).
the following command produces 2 output files:
$ csplit -k input.txt /started/
however expect lot more, can seen in:
$ grep -i started input.txt |wc -l $ 146
what correct csplit
command?
thanks
just add {*}
@ end:
$ csplit -k input.txt /started/ {*}
the man page says:
{*} repeat previous pattern many times possible.
demo:
$ cat file 1 foo 2 foo 3 foo $ csplit -k file /foo/ {*} 2 6 6 4 $ ls -tr xx* xx03 xx02 xx01 xx00 $ csplit --version csplit (gnu coreutils) 7.4
Comments
Post a Comment