How to convert all text in a file from upper case to lower case and vice versa on Linux? Convert from upper case to lower case: tr ‘[:upper:]’ ‘[:lower:]’ < input.txt > output.txt Convert from lower case to upper case: tr ‘[:lower:]’ ‘[:upper:]’ < input.txt > output.txt Answered by Eric Z Ma.
How to convert between Simplified Chinese and Traditional Chinese characters in text files on Linux from command line? You can use opencc to convert between Traditional Chinese and Simplified Chinese: https://github.com/BYVoid/OpenCC For example, to transfer a file in simplified Chinese sc.txt to traditional Chinese: opencc -i sc.txt -o tc.txt -c zhs2zht.ini The authors also provide […]
How to convert between dos and unix file coding for files in Emacs? From Dos to Unix coding: M-x set-buffer-file-coding-system RET undecided-unix or C-x RET f undecided-unix Then save the file (C-x C-s). From Unix to Dos M-x set-buffer-file-coding-system RET undecided-dos or C-x RET f undecided-dos Then save the file (C-x C-s). Answered by Eric […]
git merge is frequently used during development of projects managed by git. There are many common questions about git merge and I find most are solved and discussed on StackOverflow. Here, I summarize useful ones so that others who want to learn git merge need to do the search again. Merge, rebase, fast forward and […]
The built-in indenting in Vim for OCaml seems not very good. How to set up auto indenting for OCaml code in Vim? ocp-indent works very well for me. This posts introduces how to configure Vim to use ocp-indent to automatically indent/format OCaml code. First, install ocp-indent after installing opam: $ opam install ocp-indent Second, configure […]