Created
April 16, 2025 07:04
-
-
Save sepastian/e06f934760c2c97116f62cd750d68bbf to your computer and use it in GitHub Desktop.
Quote a list of strings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Given a comma-separated list of strings, | |
# quote each string separately in double-quotes | |
# for exampe, for using the list of strings in Python. | |
# | |
# Use sed to replace word boundaries (\b) with a quote character ("). | |
head -1 some_csv_file.csv | sed -e 's|\b|"|g' | |
# head -1 topic_to_policy_llm_CORRECTED.csv | |
# topic_id,match,policy_field_flo,policy_field_llm,topic,source,policy_id_llm | |
# head -1 topic_to_policy_llm_CORRECTED.csv | sed -e 's|\b|"|g' | |
# "topic_id","match","policy_field_flo","policy_field_llm","topic","source","policy_id_llm" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment