14,953
edits
| Line 183: | Line 183: | ||
{{kbd | key=<nowiki>sed ':a;N;$!ba;s/\n/; /g' old.filename > new.filename</nowiki>}} <ref>參考 [http://stackoverflow.com/questions/1251999/sed-how-can-i-replace-a-newline-n unix - sed: How can I replace a newline? ]</ref> | {{kbd | key=<nowiki>sed ':a;N;$!ba;s/\n/; /g' old.filename > new.filename</nowiki>}} <ref>參考 [http://stackoverflow.com/questions/1251999/sed-how-can-i-replace-a-newline-n unix - sed: How can I replace a newline? ]</ref> | ||
<div style="float: left; width: 100%; position: relative; display: block; clear: left;"> | |||
<div style="width: 46%; float: left; margin:0 auto; position: relative; display: block; "> | |||
==== 將每行的文字,都加上逗號分隔 ==== | |||
<pre> | |||
// before | |||
Elmo | |||
Emie | |||
Granny Bird | |||
// after | |||
Elmo, Emie, Granny Bird | |||
</pre> | |||
方法: 使用 [http://www.sublimetext.com/ Sublime Text] 或 [https://zh-tw.emeditor.com/ EmEditor]。 | |||
* Find what: {{kbd | key = <nowiki>\n</nowiki>}} | |||
* Replace with: {{kbd | key = <nowiki>, </nowiki>}} | |||
</div> | |||
<div style="width: 46%; float: left; margin:0 auto; position: absolute; display: block; left: 54%; top: 0;"> | |||
==== 將逗號分隔的文字,還原成逐行顯示,並且移除分隔符號 (,) ==== | |||
<pre> | |||
// before | |||
Elmo, Emie, Granny Bird | |||
// after | |||
Elmo | |||
Emie | |||
Granny Bird | |||
</pre> | |||
方法: 使用 [http://www.sublimetext.com/ Sublime Text] 或 [https://zh-tw.emeditor.com/ EmEditor]。{{exclaim}} 輸出結果的每行前面可能會有空白 | |||
* Find what: {{kbd | key = <nowiki>([^,]+),</nowiki>}} | |||
* Replace with: {{kbd | key = <nowiki>\1\n</nowiki>}} | |||
</div> | |||
</div> | |||
<div style="clear:both;"> </div> | |||
=== Find IP address === | === Find IP address === | ||