 Christopher Lind asks well a few different things, but today we're going to focus on the part that says Some good explanations of smart ways to work with delimiters. So let's go ahead and do that first Let's talk about what a delimiter is Basically, you'll have a file of some sort and it has information in there That's divided up into certain ways with certain characters that are the delimiters to divide things up For example, I can cat out this file called my file that txt and we have three columns each column is divided up by a space But you can have a delimiter of every basically anything and one common Delimiter is a tab. So if I cut this file, it's the same file, but it has tabs instead of spaces for each column So let's go ahead and start working with that file first because we're going to be looking at the cut command Now the cut command is used to basically cut up files based on delimiters. So what we can do here is we can say cut dash f and then the fields we want and By default cut uses tabs as delimiters So we don't even have to tell it what delimiters you use because if you don't tell it what delimiters It's just by default going to use tabs. So I'm going to say To use field one if we do that and give it our file of my tabs It shows just column one if I was to tell it f2 It's going to show column two if I say f3. It's going to show column three if I was to say F Comma three it's going to show columns one and three with a tab in between if I was to say One dash three it's going to show One through three and I can also do two through three and if I had more I can block them off I only have three columns, but if I had five columns I can do from four to seven or whatever columns I want that way Now again, this is saying that our Default delimiter here is tabs. What if your delimiter is something else such as a space? so for example, we have My file dot txt and I want to get the first column of that if I enter here It's going to show all three columns because it's looking for tabs there are no tabs So it's going to show everything up to the first tab, which there is no tab So it's going to show everything so what we have to do is tell it what delimiter we want now There's two ways you can write this you can do D backslash and then the delimiter you want in This case it's a space so I just left a double space there this first space is saying that space is our delimiter That's fine when you're working with some delimiter with spaces It's a little confusing having those two spaces there So another thing we can do is just do space and then inside quotation marks here say our delimiter in this case Is space so we do that and it returns the same thing. I can say f 2 or f 3 or 2 dash 3 Whatever we want now that we've said what our delimiter is now Again a delimiter can be any in this case with cut single character Whether it be a tab Comma it could be a letter. I can say make my here. Let's make my delimiter a capital S and here Let's make it one. So here we're showing everything before capital S, which this was someone's name either Sally or Sam what names that I use yep Sam Sam and Sally So it got to that s and just showed the first column before that these other ones They went further to in this case Tom worked in sales with the capital S and it cut the delimiter there Betty there was no capital S in her line. There's lowercase s But we are case sensitive here. So it showed her entire line same for Jim now Let's say we want to change our delimiter to something else. So for example Here I have Delimiter of space. I can say lines f 1 through 3 which would show all of my columns in this particular case But I want to change that to something else because commonly you're not going to use spaces as your delimiters One of the most common is actually commas. You might see reference to SC or sorry CSV comma separated values or comma separated Variable, I feel like it can stand for two different things. I usually say comma separated values But I think there's a like another Way that acronym works anyway, how do you make it and you can you have a CSV file that doesn't use commas It can use something else, but let's change our delimiter to something else. So in this case we can say output our delimiter and And then in quotations say what you want our delimiter to be So let's say we want to change all our delimiters to commas There we go. So I showed columns one through three and I don't have to show all I can say one and two or one and three But replace the delimiters on the output of it to whatever I put in these quotation marks over here Now we didn't change the file We just changed the output, but I can redirect this into a new thing and say my dot CSV file and now I can cat out my dot CSV And you can see that we have a file with that But our original file here of my text I can cat out and it has not been altered at all Now also another thing to think about is lots of times maybe you have Something would come it like an address that already has commas in it one way that CSV files tend to work Is to put quotations around the strings and then separate them by variables So I can actually do this and now if I cut out cat out my CSV. I actually well, no, that was actually a bad example We do have it, but we still would need to put quotations at the beginning of each line end of each line I was trying to do something on the fly that didn't work out But here we can actually add quickly add commas at the beginning and end of each line very simply using said I'm not going to get into that But I just wanted to show you the output delimiter can be anything it could be a whole sentence I can be like dash dash dash dash dash Let's just show the output instead modifying our file. I can change the limit to be dash dash pi pi or underscore or I can be like Tag or whatever. I want the delimiter of the output to be Let's see what else is there anything else I wanted to go over in this video I don't think so there's a lot more cut can do but those are some basic commands there I hope you enjoyed this tour I'm sure check out the link in the description to the full playlist because there's lots of videos in this playlist You might find useful both in the past and in the future. I am putting out videos Right now. I'm putting out a few a week that might slow down in the near future But I hope you're enjoying these if you did enjoy this video Be sure to like share subscribe and comment that helps me a lot And if you have a dollar or two or more to spare each month Think about becoming a supporter over at patreon.com forward slash metal x1000 There's a link in the description to that and like I said even a dollar a month is very appreciated And be sure to check out my website films by chris.com. That's Chris Decay There's linked to that in the description as well It's a great place to search through my videos But you can also search through them on my youtube channel and as always I hope that you have