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????
@vaporeon_ @wallhackio @aescling @monorail ah yes, i see now
you can solve this in sed but it isn’t pretty
@vaporeon_ @wallhackio @aescling @monorail i was thinking something like this (untested; may not work)
x;s/.*//;x
:outside
/^[^ ]*"/{
s/"/"\n/
H
x;s/[^\n]*$//;x
s/.*\n//
b inside
}
/ /{
s/ /,\n/
H
x;s/[^\n]*$//;x
s/.*\n//
b outside
}
b done
:inside
/^[^ ]*"/{
s/"/"\n/
H
x;s/[^\n]*$//;x
s/.*\n//
b outside
}
/ /{
s/ / \n/
H
x;s/[^\n]*$//;x
s/.*\n//
b inside
}
b done
:done
H
x
s/\n//
(note that this does not handle unquoted commas which may need to be quoted)
(can you solve this with a single regex? maybe??? but i was thinking of just writing a parser)
@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.)