I’ve a CSV file and I want to convert a specific column to lower case. What is the efficient way of doing this in linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
to change the 5th field.
There’s also
-v OFS=",", but not 100% sure how standard it is; also, quotes around,could be left out, but I kept them in for generality’s sake; so, as a variant:Note that awk fields are 1-based. sarathi’s answer does the same thing in perl, which is 0-based; make sure you choose the right index.
EDIT: as melpomene rightly notes, both cases only work for simple CSV without quotes or escapes.