Texting and Driving

In this chapter, we will cover the following recipes:

  • Using regular expressions
  • Searching and mining text inside a file with grep
  • Cutting a file column-wise with cut
  • Using sed to perform text replacement
  • Using awk for advanced text processing
  • Finding the frequency of words used in a given file
  • Compressing or decompressing JavaScript
  • Merging multiple files as columns
  • Printing the nth word or column in a file or line
  • Printing text between line numbers or patterns
  • Printing lines in the reverse order
  • Parsing e-mail address and URLs from text
  • Removing a sentence in a file containing a word
  • Replacing a pattern with text in all the files in a directory
  • Text slicing and parameter operations