![레이아웃 탭/공간 [닫기]](https://linux55.com/image/142779/%EB%A0%88%EC%9D%B4%EC%95%84%EC%9B%83%20%ED%83%AD%2F%EA%B3%B5%EA%B0%84%20%5B%EB%8B%AB%EA%B8%B0%5D.png)
나는 이 게시물을 읽었습니다.https://unix.stackexchange.com/a/7718/256195, 탭/공백이 포함되어 있지 않은 경우에만 가능 var
하지만 제 경우에는 아래 예와 같이 공백이 포함되어 있습니다.
"this is a test" this_is_a_solid_line_that_doesnot_contain_tab_or_spaces
이 명령은 column
..etc도 구분 하지만 and this
is
에서만 작동하는 것을 원합니다 ."this is a test"
this_is_a_solid_line_that_doesnot_contain_tab_or_spaces
목적: 파일에 위와 같은 줄이 여러 개 있는데 올바르게 정렬되지 않았습니다.
답변1
입력에 |
문자가 없다고 가정하면 따옴표 안에 없는 일련의 공백 |
(또는 입력에 없는 다른 문자)을 변환하고 다음으로 파이프할 수 있습니다 column -ts'|'
.
<input.txt perl -lpe 's/(".*?")|\s+/$1||"|"/ge' | column -ts'|'