William Rosener: Hello. Hello. Welcome back. One of the most important things that someone in information systems or technology needs to learn is task automation.
William Rosener: Automatically performing the same task over and over again.
William Rosener: If you were to step in my office and watch me work for a few hours, you're going to be absolutely surprised at how frequently I use some type of programming script to perform a repetitive tasks, not only saving time for resulted in much pure errors.
William Rosener: Truly make task automation powerful needs to be recursive. In other words, and it's news to call itself.
William Rosener: So it looks recursive through folders and then sub folders within those folders and then some folders within those folders and so on.
William Rosener: The Australia task automation. We're going to use a couple of simple examples I'll start off with a couple of examples in power shell and then we'll look at a simple example using VPN.
William Rosener: So the very first step I want to do is I'm going to son. I've got a little director right here.
William Rosener: I've got some mobiles licious some images and I just assume I want to rename these files and I might have 10 images or my app 10,000 images and regardless, though, it's going to be well one one command and we can rename all these files.
William Rosener: So therefore stuff. I'm going to do is come right down here and my little search box. I'm gonna hit the search and type in power shell and you're going to find that this is open source. So whether you're on a PC or Mac, if it's not already installed, it can be installed there.
William Rosener: And maybe the next thing I'm gonna do is I'm gonna come right up here. I'm going to right click somewhere in here and right click and I'm going to copy that address just, I don't have to retire.
William Rosener: And I'm gonna come right in here back the power shell to do a CD that's going to change directory. I'm going to paste and now I'm right there.
William Rosener: And then sure enough, is or there's my images of one. There's actually 10 images there. They're all called Ball one, let's just assume I want to do a simple little change here.
William Rosener: Well actually drag this on the screen recording window here on, I want to do is I want to read them those from bone.
William Rosener: And effect, adding the word wouldn't in front of it. The most going to put a dash after it. So right now for. Take a look. It's just double 110 so when I'm finished because they wouldn't as Paul dash
William Rosener: Okay, so I'm just going to grab this to kind of prevent a few mistakes here we're going to find that these you can just simply hit control the seed and do many of these automatic potassium
William Rosener: So I will be giving the child, are we looking at the current directory, I would be looking for files in with jpg
William Rosener: And then what I'm going to do is something simple to do a name, replace replace the word all with wooden bowl. So I'm just going to do and I'm going to grab all this good copy that.
William Rosener: You know, drag that right back over here. I'm going to come right over here, and I'm gonna paste
William Rosener: Numbers going to simply hit the enter key on the keyboard and now when I do a Dr. Which is a directory listing. I can see it is added wouldn't ball one window to accept with them.
William Rosener: Or if I was to come right back here. I can see. Sure enough, where if I was to go to View and details. Same thing there.
William Rosener: OK, let's take a look at another example.
William Rosener: Let's assume we've got a couple pages for this case I've got two pages, but I could have 10,000 pages and let's just take a look here. I'm going to first of all let's just open as we go to File, Open. How does take a look at this a notepad.
William Rosener: And we're just going to make a little change here doesn't matter what
William Rosener: Let's just assume on all these pages. I've got help at initial k.edu and I'm going to change that and say help would have. It's a contact and here it is the second one.
William Rosener: So the same thing. If I kind of come down here I can see help it into showcase edu or if I said, double click on these
William Rosener: It's actually an open it up in the browser. I can see help. This is my homepage I press here on academics, I can see help as well. Okay, let's I come right back here to our show. First of all, click right up here, copy the address.
William Rosener: The title, the CD.
William Rosener: I'm going to paste
William Rosener: And there are two files there. Okay. Let me go ahead and drag this over. And let's take a look at the kid before I run it.
William Rosener: Up and do a search for the word help. I'm gonna replace it with contact. I'm going to specify the directory. I'm looking at
William Rosener: And then I'm going to limit it to only files and end with HTML. So if I had some Microsoft Word documents Microsoft Excel. It's not even going to look in those only those files at the end with extension HTML.
William Rosener: And an effect. If you were to look at this code. We're going to do a search and replace or to be searching for the word help
William Rosener: Replacing it with contact. Again, I want to be looking at this. Here's my base directory. And normally, looking at files that end with the extension as the file extension HTML. So let me go ahead and grab that
William Rosener: We have all this code on the copy yet.
William Rosener: I bet out the web and come right back over here and I'm going to hit paste
William Rosener: Okay, now let me just do a little dir and I can see I was at 809 I've now gotten a 14 777 12. Okay, let's go ahead and take a look at these files so I could come here and I can just start here on homepage open with notepad.
William Rosener: Come on down here. And sure enough, it's now saying contact. It is ok.edu or if I was to double click on these
William Rosener: There we go.
William Rosener: I can see contact and contact. So just like that. I know I only did it on two files, but I could have just as easily could have been $10,000 in here and it would have made that change through all all the files there.
William Rosener: Okay, one last example, this is using BBA Visual Basic for the application and on, let me just go ahead and press on this.
William Rosener: And I'll show you what's going to happen here. So let's assume I spent a lot of time here.
William Rosener: I thought this was a great idea. I put the first name, last name in the person's name all in one cell.
William Rosener: And then I realized for literally hundreds of reasons. I probably should have separated that to this shouldn't came along and type bill he came over here and type roesner should have typed on
William Rosener: And
William Rosener: And I should come over here and type of Walker.
William Rosener: And if you're really quick. Okay, you're only taken a few seconds, but I'm almost going to guarantee
William Rosener: If you do about 100 of these you're going to start to mess up, you're going to actually introduce some spelling mistakes or maybe what you're going to do is you're going to go okay let me type in
William Rosener: Class over here and you're typing Becky here when actually this case. The first time was Baquet the last name was last
William Rosener: So let me just go ahead and show you how I did that a simple little script here and I'm going to go from
William Rosener: This, this right here is just going to declare some variables and I'm gonna go from two to eight.
William Rosener: We go from zero to 208
William Rosener: Okay, and what am I going to do, I'm going to first of all, in this case, we take a look at the data, it's very carefully formatted. I've got a comma spits last name comments based first name all of them as long as I've got anything consistent. I'll be able to do this.
William Rosener: Okay, so all I'm going to do is I'm going to go ahead and first of all, find the common position. If I was to take a look at. Take a look here. My name.
William Rosener: So I am going to find already position 12345678 I'm going to find the comma in position eight. I'm not going to take eight minus one is seven.
William Rosener: I'm going to take the left seven characters. And that's going to become the last name. I'm going to start in comma position plus two. So that's going to be a plus two is 10 and I'm extract this information and place it in first and then I'm going to simply write the data out.
William Rosener: Okay. And once I've got that code. If I go ahead and run that sure enough, it's putting some more data there. And if I wanted to just to show you here, and they'll put in
William Rosener: To dismiss here and I'll put it in Sioux, okay, I've got to make one little change to this.
William Rosener: Appeared in my Developer tab.
William Rosener: And not need to go to nine someone to drag this on over here. And rather than going to to eight. We go to tonight.
William Rosener: Okay, turn off the design mode and now extract names. And sure enough, I'm now grabbing, even though the last thing there as well.
William Rosener: Well, if I know this video learn a little bit about task automation and I think you're going to find that as your career develops, you're going to use it over and over and over again.
William Rosener: And sometimes you may need to talk to someone else, maybe initially to find out hey I've got this situation here I've got all this data needs to be slightly formatted
William Rosener: I need to rename all these files, but go ahead and talk to someone and then pretty soon you're going to go, Wow, man, you just saved me.
William Rosener: 10 hours of time just so much time and know what did you say time is much less likely chance that you do introduce some errors during the process well catch the next video. Thanks. Bye.