This recipe shows how to convert the text in a CSV column to Title Case, where the first letter of each word is capitalized.
Usage:
Convert text to Title Case
Use the following command to apply the Title Case transformation:
qsv luau map name Titlecase.lua filename.csv -o output_filename.csv
- Replace '
Titlecase.lua'
with the filename of this Lua script. - Replace '
filename.csv'
with your input CSV file.
Preview Title Case transformation
To preview the transformed CSV without saving, use the following command
qsv luau map name Titlecase.lua filename.csv | qsv table
Example:
Suppose you have a CSV file names.csv
with a column that contains names in lowercase. To convert these names to Title Case, run:
qsv luau map
Notes:
- By default, the script converts the text in the first column (index 1). You can modify the script to specify a different column.
- The transformation applies to alphabetic characters and leaves other elements (e.g., punctuation) unchanged.
Additional Links:
Learn more about Lua command here
More Articles on qsv Recipes
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article