sed로 큰따옴표 추가

wongidos의 이미지

안녕하세요.
txt파일에서
input
a,b,c
d,e,f

output
"a","b","c"
"d","e","f"

가능한가요?
도움 주셔서 감사합니다.

ymir의 이미지

각 필드의 내용이 뭐냐에 따라 조금 달라지겠지만..
적당히 이런식으로 패턴 적용해 보면 되겠네요.

$ cat input.txt
a,b,c
d,e,f
$ cat input.txt | sed 's/[a-z]*/"&"/g'
"a","b","c"
"d","e","f"
$ cat input.txt | sed 's/[^,]*/"&"/g'
"a","b","c"
"d","e","f"

되면 한다! / feel no sorrow, feel no pain, feel no hurt, there's nothing gained.. only love will then remain.. 『 Mizz 』

wongidos의 이미지

감사합니다.^^