Usage:
- Before running the recipe, make sure to enter the column index which contains the ISBN numbers in the code.
- Use the following qsv command to validate ISBN numbers and add the validation result as a new column named 'Validation' in the CSV:
qsv luau map 'Validation' validate_isbn.luau filename.csv -o newfile.csv
- Replace 'validate_isbn.luau' with the filename of this Lua script.
- Replace 'filename.csv' with the name of your input CSV file.
- The '-o' option is used to specify the output filename ('newfile.csv' in this example). - When you have the file and the recipe in different file locations
qsv luau map 'Validation' file:<Path of this recipe> filename.csv -o newfile.csv
When you need real-time preview of the csv fileqsv luau map 'Validation' validate_isbn.luau filename.csv | qsv table
Example:
Suppose the input CSV file 'books.csv' contains a column 'ISBN' which contains ISBN numbers. To validate these ISBN numbers and add the validation result as a new column named 'Validation' in the CSV, use the following command:
qsv luau map 'Validation' validate_isbn.luau books.csv -o books_with_validation.csv
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