 Okay, a viewer named Jack asks, how do you search and replace a string in more than one doc x file? And so I'm going to show you how to use a shell script to take a doc x file And then you said, you know, we're gonna basically find and replace a string and then repackage it up as a doc x file So first things first we have a document here that I created very simple I'm gonna say file and I'm gonna say save as I'm gonna save it into a folder here as my doc x and Yes, I'll replace the one that we currently have Let's make sure that we choose the proper format here Save there we go replace it. Yes Okay Next let's go ahead and go to that folder In our file browser here. Here's a doc x file right there Which you may not know is doc x file is actually a zip file which contains basically a bunch of XML files with all the settings so We could say extract here and it extracts everything if we go into this word folder There's one labeled document and if we double-click that it will open up and whatever you have to open up for me It opens up in here in Chrome and you can see this is the main document and you can see all the text Inside this Xtm XML file. So let's go ahead and Go back and delete all this except for the document itself And we will close this and let's open up our shell here And again, I'm in the folder if I list out you can see that one document And if I just use the unzip command I can unzip my doc x and at this point You probably want to unzip it to another folder. I don't switch it to this folder I'm gonna just I'm gonna remove the original doc x file But you'll probably want to have that stored somewhere and again if I cat out from the word folder the document XML you can see there it is it does it nicely formatted like it was in Chrome But it's the same XML file and if you look through here somewhere is the text of The document it's kind of hard to read when it's not formatted properly, but there there's his name right there Oh, and here we go. How to search replace a string in more than one doc x file so What I'm gonna do is I'm gonna take this how to replace a string and I'm gonna replace a string with replace a new string and I'll use that said to do that so I'll say said dash I to Modify it in place I'm gonna say s for substitute And g for the entire file Although if you just wanted to replace the first instance of it in the file you can remove that g in this case It's only one instance of it. So it doesn't really matter I'm gonna say replace string with new string And what file well again, it's in the word folder and it's called document XML We'll enter there and now what I can do is I can just say zip dash r Sorry zip and then the name of the file. I guess we can do the dash r there and then we'll say new dot doc x And we'll say all files We do that and we just create basically a new zip file with everything that was in this directory But we called it doc x because as we already know a doc x file is a zip file So if I was to go back into my word document here and I could say Open You can see there is a new doc x file where our old one was called my doc x which we deleted And if I double click that you can see that it says How to search and replace a new string? So that is how you can do it with a shell script And if you want to do multiple files because he says more than one Well, basically you would just put that into a loop So this is a quick Look at doing that and just these are videos. I'm doing to quickly answer some Some question of yours have so I thought hope you found that useful Please visit films by chris.com. That's chris of the k There should be a link in the description And remember there's other stuff in that file as well that you can look through It's just a zip file and most of it's plain text so you can go through there and probably modify other stuff such as You know fonts and whatnot, but just plain replace text as long as you're not replacing something That's actually inside the x metal tags. You should be good to go So thank you for watching and as always I hope that you have a great day