0

I have a pretty huge .csv file with the date at column 3 ( Example: 11/17/2015) and i need to replace with the date format as 2015-11-17. I tried doing using:%s/\<11/17/2015\>/2015-11-17.But couldn't see the change. Any suggestions on how to do this?.

2 Answers 2

1

I assume you are using vim:

:%s/11\/17\/2015/2015-11-17/g

You can do this also with sed without opening the file:

sed -i 's/11\/17\/2015/2015-11-17/' somefile.csv
Sign up to request clarification or add additional context in comments.

Comments

1

Try to escape backslash like:

echo "11/17/2015" | sed 's/11\/17\/2015/2015-11-17/g'
2015-11-17

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.