bad idea
@vaporeon_ s/\S+/,/g
@vaporeon_ ah fuck capital s is not whitespace? that always trips me up
@monorail @vaporeon_ extended POSIX has [:space:]
@aescling @monorail @vaporeon_ the extended POSIX square bracket shit pisses me off for no reason
@wallhackio @aescling @monorail @vaporeon_ are whitespace separated values not the default for awk????
@Lady @wallhackio @aescling @monorail Did you read the thread? Yes, values are separated by whitespace in AWK, but it doesn't handle quoting. "foo bar" would be treated as two fields "foo and bar". That's the whole problem.
@vaporeon_ @wallhackio @aescling @monorail ah yes, i see now
you can solve this in sed but it isn’t pretty
@Lady @wallhackio @aescling @monorail Is it similar to the solution that I found for AWK? https://glaceon.social/@vaporeon_/117032606228021896
(Sorry for reacting with "did you even read the thread?" when it's actually not in the same thread... Link to the actual thread I meant is above. My fault.)
@vaporeon_ @wallhackio @aescling @monorail actually, assuming that you escape " with another ", then the problem (discounting the issue of unescaped commas) is as simple as “replaces spaces with commas when the number of preceding " is even”, right? that is much simpler in sed
:start
s/^\(\(\([^"]*"\)\{2\}\)*[^" ]*\) /\1,/
t start