93 lines in this file since we know the first row contained headers, we can surmise that this is a list of 92 articles. $ wc -l jan2017articles.csvĪnd, there it is. In our case, we want to know the number of lines. Short for "word count," wc can count the number of bytes, characters, words, or lines in the file. That's great, but how big is this file? Are we talking about dozens of articles we want to analyze, or hundreds, or even thousands? The wc command can help with that. Looks like we've got a list of articles with the date they were published, the type of content for each one, the author, title, number of comments, relative URL, the tags each article has, and the word count. Post date,Content type,Author,Title,Comment count,Path,Tags,Word count Let's look at the top of the file and see if it has headers to explain what each column means: $ head -n 1 jan2017articles.csv Looking at those last three lines, I can pick out a date, author name, title, and a few other pieces of information immediately. ,Poll,Jason Baker,What is your open source New Year's resolution?,1,/poll/17/1/what-your-open-source-new-years-resolution,186 ,Article,Jen Wike Huger,The preview for January,0,/article/17/1/editorial-preview-january,358 ,Article,Scott Nesbitt,3 tips for effectively using wikis for documentation,1,/article/17/1/tips-using-wiki-documentation,"Documentation, Wiki",710 If you don't specify the number of lines you want to see, you'll get 10. Both are utilities for showing a specified number of lines from the top or bottom of the file. What's in it? What does its format look like? You can use the cat command to display a file in the terminal, but that's not going to do us much good if you're working with files more than a few dozen lines.Įnter head and tail. So let's try out a few of the many simple open source tools for data analysis and see how they work! If you'd like to follow along with these examples, go ahead and download this sample data file, from GitHub, which is a CSV (comma separated value) list of articles we published to in January.įirst, let's get started by getting a handle on the file. Free online course: RHEL Technical Overview.
0 Comments
Leave a Reply. |