Working with Grep, Sed, and Awk Pocket Primer / Работа с Grep, Sed и Awk Год издания: 2023 Автор: Campesato Oswald / Кампесато Освальд Издательство: Mercury Learning and Information ISBN: 978-150152-151-5 Язык: Английский Формат: PDF (NotTrue), EPUB Качество: Издательский макет или текст (eBook) Интерактивное оглавление: Да Количество страниц: 384 Описание: The goal of this book is to introduce readers to three powerful command line utilities that can be combined to create simple yet powerful shell scripts for performing a multitude of tasks. The code samples and scripts use the bash shell, and typically involve very small text files so that you can focus on understanding the features of grep, sed, and awk. In the simplest terms, grep (global regular expression print) will search input files in data for certain words or word patterns and print the lines that match it. sed is useful for changing or modifying data. Awk is a programming language also used for searching a data file for certain patterns, but can also perform certain tasks on the pattern matches it finds. Aimed at a reader relatively new to working in a bash environment, the book is comprehensive enough to be a good reference and teach a few new tricks to those who already have some experience with these command line utilities. FEATURES: Designed for readers relatively new to working in a bash environment Introduces readers to three powerful command line utilities that can be combined to createsimple yet powerful shell scripts for performing a multitude of tasks Includes numerous code samples and scripts using the bash shell, and typically involvesmall, text files Features a separate chapter on regular expressions using these tools Цель этой книги - познакомить читателей с тремя мощными утилитами командной строки, которые можно комбинировать для создания простых, но мощных сценариев оболочки для выполнения множества задач. Примеры кода и скрипты используют оболочку bash и обычно содержат очень маленькие текстовые файлы, так что вы можете сосредоточиться на понимании функций grep, sed и awk. Проще говоря, grep (global regular expression print) будет искать во входных файлах данных определенные слова или словосочетания и печатать соответствующие им строки. sed полезен для изменения данных. Awk - это язык программирования, который также используется для поиска в файле данных определенных шаблонов, но также может выполнять определенные задачи с найденными совпадениями шаблонов. Предназначена для читателей, довольнольно плохо знакомых с работой в среде bash, книга достаточно всеобъемлюща, чтобы стать хорошим справочником и научить нескольким новым приемам тех, у кого уже есть некоторый опыт работы с этими утилитами командной строки. Особенности: Написана для читателей, довольнольно плохо знакомых с работой в среде bash. Знакомит читателей с тремя мощными утилитами командной строки, которые можно комбинировать для создания простых, но мощных сценариев оболочки для выполнения множества задач Включает многочисленные примеры кода и скрипты, использующие оболочку bash, и обычно включает небольшие текстовые файлы Содержит отдельную главу, посвященную регулярным выражениям, использующим эти инструменты
Примеры страниц
Оглавление
Preface Chapter 1 Working with grep What is the grep Command? Meta Characters and the grep Command Escaping Meta Characters with the grep Command Useful Options for the grep Command Character Classes and the grep Command Working with the –c Option in grep Matching a Range of Lines Using Backreferences in the grep Command Finding Empty Lines in Datasets Using Keys to Search Datasets The Backslash Character and the grep Command Multiple Matches in the grep Command The grep Command and the xargs Command Searching Zip Files for a String Checking for a Unique Key Value Redirecting Error Messages The egrep Command and fgrep Command Displaying “Pure” Words in a Dataset with egrep The fgrep Command Delete Rows with Missing Values A Simple Use Case Summary Chapter 2 Working with sed What is the sed Command? The sed Execution Cycle Matching String Patterns Using sed Substituting String Patterns Using sed Replacing Vowels from a String or a File Deleting Multiple Digits and Letters from a String Search and Replace with sed Regular Expressions with sed Datasets with Multiple Delimiters Useful Switches in sed Working with Datasets Printing Lines Character Classes and sed Removing Control Characters Counting Words in a Dataset Back References in sed One-Line sed Commands Populate Missing Values with the sed Command A Dataset with 1,000,000 Rows Numeric Comparisons Counting Adjacent Digits Average Support Rate Summary Chapter 3 Working with awk The awk Command Launching awk Commands and File Extensions Built-In Variables that Control awk How Does the awk Command Work? Three Important Code Blocks in awk Commands Different Ways to Print Text Working with the -F Switch in awk Splitting Strings into Characters The PROCINFO Array Ignore Case in awk Working with OFS, ORS, and Linefeed versus “\n” Linefeed versus “\n” Basic awk Examples with Text Files Display the Contents of a File Omit the Header Line of a File Display a Range of Lines in a Text File With NR Display a Range of Lines Based on Strings Insert Blank Lines Remove Blank Lines Specifying the Number of Fields Changing the Field Separator FS Exclude Fields Switch Adjacent Fields Display Fields in Reverse Order Count Non-Empty and Empty Rows Detecting Transfer Protocols Detecting Number Formats Working with Record Lengths Aligning Text with the printf() Statement Working with Loops in awk A for Loop in awk Exponents in a for Loop A for Loop with a break Statement Working with while Loops in awk A do-while Loop in awk Conditional Logic and Control Statements The break, continue, and next Keywords in awk The exit Keyword Conditionally Displaying Fields Logical Operators in awk Logical Operators and Partial Matches Checking for Leap Years Formatting Output Floating Point Output Inserting a Thousands Separator Scientific Notation Rounding and Truncating Numbers Rounding Numbers Truncating Numbers Numeric Functions in awk Convert Base 10 to Binary Built-In String Functions in awk Convert Strings to Lowercase in awk Convert Strings to Uppercase in awk Convert Strings to Mixed Case in awk Counting Lines that Match a Character Working with the match() Function Characters and Hexadecimal Numbers in awk Non-Printable Characters Hexadecimal Numbers Summary Chapter 4 Working with awk, Part 2 Working with Arrays in awk Initializing and Printing the Contents of an Array Initializing and Deleting the Contents of an Array Adding an Array of Numbers Find the Maximum and Minimum of an Array of Numbers Concatenating an Array of Strings Generating Arrays from Input Strings The split() Function with Linefeed Strings Using the split() Function with the case Statement The patsplit() Function Multi-Dimensional Arrays Higher Dimensionality Arrays Calculating Invoice Totals (1) Calculating Invoice Totals (2) Calculating Invoice Averages Counting Fields in Text Files Displaying the Number of Fields in Text Files Deleting Alternate Lines in Datasets Print a Range of Strings in Datasets Print a Range of Dates in Datasets Merging Lines in Datasets Printing File Contents as a Single Line Joining Groups of Lines in a Text File Joining Alternate Lines in a Text File Reversing the Lines in a File Working with Duplicate Lines in a File Display Duplicate Rows Remove Duplicate Rows Uniformity of Data Values Count Duplicate Fields in a File Calculating Invoice Totals Printing Lines Using Conditional Logic Duplicate and Unique Rows in Text Files Splitting Filenames with awk One-Line awk Commands Useful Short awk Scripts Printing the Words in a Text String in awk Count Occurrences of a String in Specific Rows Well-Known Sorting Algorithms The Bubble Sort Find Anagrams in a List of Words Sort an Array in O(n) Complexity Find the Median of an Array of Numbers Linear Search Binary Search (Iterative) Binary Search Walkthrough Code for a Binary Search (Iterative) Binary Search (Recursive) Summary Chapter 5 Working with awk, Part 3 Bit Operations in awk Logical AND Logical OR Logical XOR Logical NOT Logical Left Shift Logical Right Shift Reverse a String Find Palindromes Check for Unique Characters Check for Balanced Parentheses Printing a String in a Fixed Number of Columns Printing a Dataset in a Fixed Number of Columns Aligning Columns in Datasets Aligning Columns and Multiple Rows in Datasets Displaying a Subset of Columns in a Text File Subsets of Columns Aligned Rows in Datasets Longest/Shortest Words in Datasets Counting Word Frequency in Datasets Displaying Only “Pure” Words in a Dataset Delete Rows with Missing Values Working with Multiline Records in awk CSV Files with Multirow Records Processing Multiple Files with awk Inner Join of Two Files in awk Logical Operators in awk A Simple Use Case Another Use Case Date Conversion A Dataset with 1,000,000 Rows Numeric Comparisons Counting Adjacent Digits Average Support Rate What is Recursion? Arithmetic Series Calculating Arithmetic Series (Iterative) Calculating Arithmetic Series (Recursive) Calculating Partial Arithmetic Series Geometric Series Calculating a Geometric Series (Iterative) Calculating Arithmetic Series (Recursive) Factorial Values Fibonacci Numbers Euclid’s Algorithm (GCD) Lowest Common Multiple of Two Positive Integers Composite versus Prime Numbers Factors of Positive Integers Goldbach’s Conjecture Environment Variables in awk Summary Chapter 6 Regular Expressions What are Regular Expressions? Metacharacters Character Sets Working with “^” and “\” Character Classes POSIX Character Classes Generic Character Classes Regular Expressions in awk Matching Strings with the Dot “.” Metacharacter Matching Strings with the “^” Metacharacter Matching Strings with the “$” Metacharacter Matching Strings with the “|” Metacharacter Matching with ?, +, or * Metacharacters Matching Subgroups with ?, +, or * Metacharacters Matching with Character Classes Working with Postfix Arithmetic Operators Working with the sub() Function in awk Examples Using the sub() Function Working with the gsub() Function Removing Digits with the gsub() Function Removing Characters with the gsub() Function Removing Consecutive Characters with the gsub() Function Removing Complements of Strings with the gsub() Function Removing Metacharacters with the gsub() Function Removing Spaces in Text Fields Splitting Strings with Regular Expressions Dynamic Regular Expressions Regular Expressions Involving Text Files Counting Comments with Regular Expressions Combining grep with awk Combining sed with awk Removing HTML Tags The gensub() Function and Captured Groups Summary Index
[only-soft.org].t182639.torrent
Торрент:
Зарегистрирован
[ 2023-07-05 04:25 ]
6 KB
Статус:
√проверено
Скачан:
1 раз
Размер:
4 MB
Оценка:
(Голосов: 0)
Поблагодарили:
0
Campesato Oswald / Кампесато Освальд - Working with Grep, Sed, and Awk Pocket Primer / Работа с Grep, Sed и Awk [2023, PDF, EPUB, ENG] скачать торрент бесплатно и без регистрации
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете голосовать в опросах Вы не можете прикреплять файлы к сообщениям Вы можете скачивать файлы