2018-12-20 12:47:04 +00:00
# textutil
> Used to manipulate text files of various formats.
2022-01-14 12:59:47 +00:00
> More information: <https://ss64.com/osx/textutil.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`