Using qsv Recipe to Decode HTML/XML Entities in CSV Columns

Created by datHere Support, Modified on Tue, 10 Sep at 10:15 AM by datHere Support

This recipe helps you decode common HTML/XML entities (like &, <, etc.) in a specific CSV column, replacing them with their respective characters.


Usage:

Decode entities in a column

Use the following command to decode HTML/XML entities and save the output:


qsv luau map --map DecodedColumn decode_entities.lua filename.csv -o output_filename.csv 
  • Replace decode_entities.lua with the filename of this Lua script.
  • Replace filename.csv with the input CSV file.


Preview the decoded content

To preview the decoded column without saving the file, use this command:  


qsv luau map --remap DecodedColumn decode_entities.lua filename.csv | qsv table 


Notes:

  • This script decodes common entities like &, <, >, ", and '.


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

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article