Search Results

Search: Posts Made By: disedorgue
12,893
Posted By disedorgue
With awk: $ echo $STRING | awk -F'|'...
With awk:
$ echo $STRING | awk -F'|' '{$NF=$NF"\\";X=NF;for(i=1;i<=NF;++i){ $i ~ /\\$/ && --X};print X}'
9

Regards.
12,893
Posted By disedorgue
Hi, for fun, in bash: $ echo $STRING ...
Hi, for fun, in bash:
$ echo $STRING
12345678|ABN\|XYZ MED CHEM PTY. LTD.|C||100.00|22|AB"C\|Corp|"XYZ|CDEF"|
$ X=${STRING//\\|/} && X=${X//[^|]/} && echo ${#X}
9


Regards.
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 06:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy