Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Remove specific characters in bash

I have a bunch of files that look like this:

file1.csv
['Dog']
['Cat']
['Snake']

file2.csv
['Dog']
['Cat']
['Snake']
['Cat']
['Snake']
['House']

I want to remove the [' and '] characters from these files in a loop. How can I achieve this?

The result would look like this:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

file1.csv
Dog
Cat
Snake

>Solution :

With tr:

tr -d "[']" < file
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading