csplit regex with pipe (|)
3
votes
1
answer
1255
views
i want to split file by regular expression, i have file format as below
0|t| lorem ...
some text
138|t| title
some text
if i execute
egrep "[0-9]+\|t\|" file | wc -l
it counts occurrence correctly but if i execute csplit filename /[0-9]+\|t\|/
then it says no match found and does not split file.
seems some issue with pipe in pattern but not able to figure out solution.
Asked by Jigar Parekh
(133 rep)
Mar 30, 2017, 05:58 AM
Last activity: Oct 15, 2022, 08:52 PM
Last activity: Oct 15, 2022, 08:52 PM