Using qsv recipe to Validate ISBN codes

Created by datHere Support, Modified on Thu, 02 May 2024 at 08:08 AM by datHere Support

Usage:

  1. Before running the recipe, make sure to enter the column index which contains the ISBN numbers in the code.
  2. 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).
  3. 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 file 
    qsv 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

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article