텍스터 번들 파일을 autokey 파일로 변환하는 명령을 작성하려고합니다. texter 파일과 같이 포맷 :awk가 첫 번째 문자를 기준으로 행을 병합합니다.
"items": [
{
"usageCount": 0,
"omitTrigger": false,
"prompt": false,
"description": "description",
"abbreviation": {
"ignoreCase": false,
"wordChars": "[\\w]",
"immediate": false,
"abbreviation": "ABBREVIATION GOES HERE",
"backspace": true,
"triggerInside": false
},
"hotkey": {
"hotKey": null,
"modifiers": []
},
"phrase": "REPLACEMENT TEXT GOES HERE",
"modes": [
1
],
"showInTrayMenu": false,
"matchCase": false,
"filter": null,
"type": "phrase",
"sendMode": "kb"
I :
.abbr
This would be the replacement text for the line above in texter.
.day
Have a GREAt day!
.but
But some of the
information takes up multiple lines
.how
However all the abbreviations
start with a "." and
then x lines of text to be
내가 별도의 파일에 각 1 점을 추가하는 듯 또는 abbrevation 다음과 같은 형식으로 해당 필드로의 대체 텍스트를 인쇄해야 awk로 포맷팅 부분을 처리 할 수 있다고 확신하지만 어떻게 적절한 축약과 적절한 대체 텍스트를 얻을 수 있습니까? 나는 함께했다 Heres는 무엇을 위해 내가 그들을 포맷 할 수 있지만 나에게 가까이 F에 대한 오류 제공하는 개별 파일로 인쇄 :
이awk '/^\./ {f="$title\."++d} f{print > f} /^\./ {close f; f=""}'
이 스크립트는 늘 일을하거나 내가 쓴 :
#!/bin/sh
while read line
do
if echo $line | grep "^\."; then
line_no=`echo $line | awk -F "\." '{ print $2 }'
elif echo $line | grep "^\."; then
: #ignore
else
echo "$line" >> t2ak.$line_no
fi
done < Default.texter
귀하의 질문을 이해할 수 있을지 확실하지 않습니다. 위의 예제 입력으로 4 개의 autokey 파일을 만들 예정입니까? 내가 너를 올바르게 이해하지 못한다면 예상되는 결과물로 질문을 갱신 할 수 있겠는가? 건배. – Steve