Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Searches all csv files in directory for pipes and replaces them with commas ("|" with ",")
- # sed basic usage
- # sed -i 's/foo/bar/g' FILENAME (s tells sed to search, foo = search string, bar = replace string, g = all chars on each line)
- # special characters like commas require an escape e.g. \, but not all special chars for example a pipe '|' does not
- # it is best to wrap this in a for loop to avoid breaking command line limits
- for i in *csv; do
- sed -i 's/|/\,/g' $i
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement