how to use a string as a delimiter?
3 posters
how to use a string as a delimiter?
In the cut command we can use only one character as the delimiter with the -d switch.
but i want to use a string or a pattern as a delimiter how can i do it?
and i wanna know if we have any other command for column delimiter??
but i want to use a string or a pattern as a delimiter how can i do it?
and i wanna know if we have any other command for column delimiter??
Re: how to use a string as a delimiter?
Cut allows only a single character delimiter.String as a delimiter not possible with cut.
Maithreyi- Posts : 76
Points : 142
Join date : 2010-03-03
Age : 36
Location : Haldia
Re: how to use a string as a delimiter?
do we have any other vertical delimiter other than cut command?
Re: how to use a string as a delimiter?
@ganesh
try this:
$cat abc.txt
123li456li789
987li654li321
$awk -F "li" '{print $1}' abc.txt
123
987
try this:
$cat abc.txt
123li456li789
987li654li321
$awk -F "li" '{print $1}' abc.txt
123
987
akalya- Posts : 70
Points : 86
Join date : 2010-03-04
Permissions in this forum:
You cannot reply to topics in this forum