Can I bulk edit multiple file with VS Code?
·
Answer a question
I have around 50 markdown files with frontmatter. Something like this:
---
title: Funny Title
date: 2020-01-09
---
I'd like to edit all of the files such that I have the following:
---
title: Conference Volunteering
dateCreated: 2020-01-09
dateUpdated: 2020-01-09
That's it. I was able to right a macro in Vim to do this for me, but did not find a way to run this on multiple files. Now I'm thinking there must be a way to do this in VS Code.
For example, I can search and replace date with dateCreated in all *.md files. That would get me halfway there, I just can't figure out how to also duplicate this line and replace dateCreated with dateUpdated
Any help appreciated. If you need more details/explanations, please let me know.
Answers
do a regex search with
Search: date: (.*)
Replace: dateCreated: $1\ndateUpdated: $1
更多推荐
所有评论(0)