How use CUT with several chars delimiter (not a single char) ?
Hello
myfile.txt contains: Code:
string1 = stri/*-sdf:/()()/*'##+ng2 Code:
cat myfile.txt | cut -d" : " -f1 Is tehre any solutiosn? (no perl) |
if found for the moment, this solution only:
Code:
cat myfile.txt | awk -F" : " '{print $1; print $2}' |
Quote:
cut takes a single char. |
Try using tr 'chars' 'char' to preprocess, e.g.
Code:
echo 'one,two three|target' | tr ',|' ' ' | cut -d' ' -f4 Code:
echo 'one = target' | sed 's/ = /@/g' | cut -d'@' -f2 |
Code:
#!/bin/bash |
maybe i am blind, but where in your data do you have " : " delimeter?
|
True that, you only have:
"f:/" not : "f : /" |
All times are GMT -5. The time now is 02:26 PM. |