osx - how to run cut command using single tick as a delimiter? -
i'm on mac 10.9.2 , trying take out data sql file.
it has portions of csv values wrapped in single ticks ('), , take out field 5
here have far, , reason > @ end, asking me complete action, expect results?
sh-3.2# more data.sql | cut -d ',' -s -f 5 | cut -d '\'' -f 1 >
maybe there easier solution cutting? :)
the problem using attempting escape single quote within single quotes. use different pair of enclosing quotes without escaping, or eliminate quotes altogether, i.e. either:
cut -d\' -f2
or
cut -d"'" -f2
(an alternate solution might available given sample data.)
Comments
Post a Comment