2018-12-20 12:47:04 +00:00
# textutil
2024-02-14 20:25:13 +00:00
> Manipulate text files of various formats.
2024-01-31 10:20:27 +00:00
> More information: <https://keith.github.io/xcode-man-pages/textutil.1.html>.
2018-12-20 12:47:04 +00:00
2021-01-31 17:05:18 +00:00
- Display information about `foo.rtf` :
2018-12-20 12:47:04 +00:00
2023-02-20 07:05:58 +00:00
`textutil -info {{path/to/foo.rtf}}`
2018-12-20 12:47:04 +00:00
2021-01-31 17:05:18 +00:00
- Convert `foo.rtf` into `foo.html` :
2018-12-20 12:47:04 +00:00
2023-02-20 07:05:58 +00:00
`textutil -convert {{html}} {{path/to/foo.rtf}}`
2018-12-20 12:47:04 +00:00
- Convert rich text to normal text:
2023-02-20 07:05:58 +00:00
`textutil {{path/to/foo.rtf}} -convert {{txt}}`
2018-12-20 12:47:04 +00:00
2021-01-31 17:05:18 +00:00
- Convert `foo.txt` into `foo.rtf` , using Times 10 for the font:
2018-12-20 12:47:04 +00:00
2023-02-20 07:05:58 +00:00
`textutil -convert {{rtf}} -font {{Times}} -fontsize {{10}} {{path/to/foo.txt}}`
2018-12-20 12:47:04 +00:00
2021-01-31 17:05:18 +00:00
- Load all RTF files in the current directory, concatenates their contents, and writes the result out as `index.html` with the HTML title set to "Several Files":
2018-12-20 12:47:04 +00:00
2023-02-20 07:05:58 +00:00
`textutil -cat {{html}} -title "Several Files" -output {{path/to/index.html}} *.rtf`