.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # sed-awk
2 |
3 | ## TLDR
4 |
5 | ```bash
6 | $ tldr sed
7 | sed
8 | Run replacements based on regular expressions.
9 |
10 | - Replace the first occurrence of a string in a file, and print the result:
11 | sed 's/find/replace/' filename
12 |
13 | - Replace only on lines matching the line pattern:
14 | sed '/line_pattern/s/find/replace/'
15 |
16 | - Replace all occurrences of a string in a file, overwriting the file (i.e. in-place):
17 | sed -i 's/find/replace/g' filename
18 |
19 | - Replace all occurrences of an extended regular expression in a file:
20 | sed -r 's/regex/replace/g' filename
21 |
22 | - Apply multiple find-replace expressions to a file:
23 | sed -e 's/find/replace/' -e 's/find/replace/' filename
24 | ```
25 |
26 | ```bash
27 | $ tldr awk
28 |
29 | awk
30 | A versatile programming language for working on files.
31 |
32 | - Print the fifth column in a space separated file:
33 | awk '{print $5}' filename
34 |
35 | - Print the second column of the lines containing "something" in a space separated file:
36 | awk '/something/ {print $2}' filename
37 |
38 | - Print the third column in a comma separated file:
39 | awk -F ',' '{print $3}' filename
40 |
41 | - Sum the values in the first column and print the total:
42 | awk '{s+=$1} END {print s}' filename
43 |
44 | - Sum the values in the first column and pretty-print the values and then the total:
45 | awk '{s+=$1; print $1} END {print "--------"; print s}' filename
46 | ```
47 |
48 | ## Useful Commands
49 |
50 | ```bash
51 | # List out the second column in the table.
52 | cat text/table.txt | sed 1d | awk '{ print $2 }'
53 |
54 | # Sum the columns in the table.
55 | cat text/table.txt | sed 1d | awk '{ sum += $2 } END { print sum }'
56 |
57 | # Kills all processes by name.
58 | ps aux | grep chrome | awk '{ print $2 }' | kill
59 | pkill chrome
60 |
61 | # Deletes trailing whitespace.
62 | sed 's/\s\+$//g' filename
63 |
64 | # Deletes all blank lines from file.
65 | sed '/^$/d' filename
66 |
67 | # Insert 'use strict' to the top of every js file.
68 | sed "1i 'use strict';" *.js
69 |
70 | # Append a new line at the end of every file.
71 | sed '1a \n' *
72 |
73 | # Generate random numbers and then sort.
74 | for i in {1..20}; do echo $(($RANDOM * 777 * $i)); done | sort -n
75 |
76 | # Commatize numbers.
77 | sed -r ':loop; s/(.*[0-9])([0-9]{3})/\1,\2/; t loop' text/numbers.txt
78 | ```
79 |
80 | ## Tutorial
81 | Follow the tutorials here:
82 | - http://www.thegeekstuff.com/tag/sed-tips-and-tricks/
83 | - http://www.grymoire.com/Unix/Sed.html
84 | - http://www.grymoire.com/Unix/Awk.html
85 |
86 | ```bash
87 | # Unzip data.
88 | unzip data.zip
89 |
90 | # Zip data.
91 | zip -r data.zip data/
92 |
93 | # Preview the files.
94 | head data/names.csv && tail data/names.csv
95 |
96 | # Preview csv columns.
97 | sed -n 1p data/colleges.csv | tr ',' '\n'
98 |
99 | # Count the number of lines.
100 | wc -l data/*
101 | ```
102 |
103 | ### Sed Print
104 |
105 | ```sh
106 | # Print contents of a file.
107 | sed -n '/fox/p' text/*
108 | sed -n '/Sysadmin/p' text/geek.txt
109 |
110 | # Print lines starting with `3` and skipping by `2`.
111 | sed -n '3~2p' text/geek.txt
112 |
113 | # Print the last line.
114 | sed -n '$p' text/geek.txt
115 |
116 | # Prints the lines matching the between the two patterns.
117 | sed -n '/Hardware/,/Website/p' text/geek.txt
118 | ```
119 |
120 | ### Sed Print Line Number
121 |
122 | ```sh
123 | # Prints the line number for all lines in the file.
124 | sed -n '=' filename
125 |
126 | # Prints the line number that matches the pattern.
127 | sed -n '/Linux/=' filename
128 |
129 | # Prints the line number in range of two patterns (inclusive).
130 | sed -n '/Linux/,/Hardware/=' filename
131 |
132 | # Prints the total number of lines.
133 | sed -n '$=' filename
134 | ```
135 |
136 | ### Sed Delete
137 | The `d` command performs a deletion.
138 |
139 | ```sh
140 | # Deletes the 3rd line from beginning of file.
141 | sed '3d' text/geek.txt
142 |
143 | # Delete every lines starting from 3 and skipping by 2.
144 | sed '3~2d' text/geek.txt
145 |
146 | # Delete lines from 3 to 5.
147 | sed '3,5d' text/geek.txt
148 |
149 | # Delete the last line.
150 | sed '$d' text/geek.txt
151 |
152 | # Delete lines matching the pattern.
153 | sed '/Sysadmin/d' text/geek.txt
154 | ```
155 |
156 | ### Sed Substitute
157 | The `s` command performs a substitution.
158 |
159 | ```sh
160 | # Simple substituion for the first result.
161 | sed 's/Linux/Unix/' text/geek.txt
162 |
163 | # Simple substituion for global instances.
164 | sed 's/Linux/Unix/g' text/geek.txt
165 |
166 | # Replace nth instance.
167 | sed 's/Linux/Unix/2' text/geek.txt
168 |
169 | # Write matched lines to output.
170 | sed -n 's/Linux/Unix/gp' text/geek.txt > text/geek-sub.txt
171 |
172 | # Use regex group for capturing additional patterns (up to 9).
173 | sed 's/\(Linux\).\+/\1/g' text/geek.txt
174 | sed -r 's/(Linux).+/\1/g' text/geek.txt
175 |
176 | # Remove the last word.
177 | sed -r 's/\d$//g' text/geek.txt
178 |
179 | # Remove all letters.
180 | sed -r 's/[a-zA-Z]//g' text/geek.txt
181 |
182 | # Remove html tags (WIP).
183 | sed -r 's|(?[a-z]+>)||g' text/html.txt
184 |
185 | # Commatize any number.
186 | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta' text/numbers.txt
187 | sed -r ':loop; s/\B[0-9]{3}\>/,&/; t loop' text/numbers.txt
188 | ```
189 |
190 | ### Sed Transform
191 | The `y` command performs a transformation.
192 |
193 | ```sh
194 | # Converts all lowercase chars to uppercase.
195 | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' text/geek.txt
196 |
197 | # Converts all uppercase chars to lowercase.
198 | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' text/geek.txt
199 |
200 | # Perform a two character shift.
201 | sed 'y/abcdefghijklmnopqrstuvwxyz/cdefghijklmnopqrstuvwxyzab/' text/geek.txt
202 | ```
203 |
204 | ### Sed Multiple Commands
205 | The `-e` flag allows for multiple commands.
206 |
207 | ```sh
208 | sed -r -e 's/etc\.*//g' -e 's/(\s+)(\))/\2/g' text/geek.txt
209 | ```
210 |
--------------------------------------------------------------------------------
/_awk.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Description:
4 | # Examples of basic awk usage with the files in '/text'.
5 | # http://www.thegeekstuff.com/2010/01/awk-introduction-tutorial-7-awk-print-examples/
6 | #
7 | # Syntax:
8 | # awk '/search pattern1/ {Actions}
9 | # /search pattern2/ {Actions}' file
10 | #
11 |
12 | # Command without search pattern will perform action on all lines.
13 | awk '{ print; }' text/employee.txt
14 |
15 | # Command without action will print the lines matching the pattern.
16 | awk '/Technology/' text/employee.txt
17 | sed -n '/Technology/p' text/employee.txt
18 |
19 | # Multiple patterns with regex.
20 | awk '/(Tech)|(Market)/' text/employee.txt
21 |
22 | # Print columns. $NF contains the number of columns.
23 | awk '{ print $2, $NF }' text/employee.txt
24 |
25 | # Multi-line block.
26 | awk 'BEGIN { print "Beginning this command"; }
27 | { print $2, $NF; }
28 | END { print "End of this command"; }' text/employee.txt
29 |
30 | # Same as above written as one line.
31 | awk 'BEGIN { print "Beginning this command"; } { print $2, $NF; } END { print "End of this command"; }' text/employee.txt
32 |
33 | # Find the employee with an id greater than 200.
34 | awk '$1 > 200' text/employee.txt
35 |
36 | # Match column to regex.
37 | awk '$4 ~ /[tT]echnology/' text/employee.txt
38 |
39 | # Sum columns.
40 | awk '{ s += $1; print $1} END { print s }' text/employee.txt
41 |
42 | # Sum column, only get result.
43 | awk '{ s += $1 } END { print s }' text/employee.txt
44 |
45 | # Sum columns with full syntax.
46 | awk 'BEGIN { s=0 } { s += $1 } END { print s }' text/employee.txt
47 |
--------------------------------------------------------------------------------
/_awk_sed.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Show all the male births in NY.
4 | sed -rn '/NY.+boy/p;' data/births.csv
5 |
6 | # Sum the number of male births in NY.
7 | sed -rn '/NY.+boy/p' data/births.csv | awk -F',' '{ s+=$4; } END { print s }'
8 |
9 | # Sum the numer of male births in NY since the year 2000.
10 | sed -rn '/NY.+boy/p' data/births.csv | awk -F',' '{ if ($1 >= 2000) s+=$4 } END { print s }'
11 |
--------------------------------------------------------------------------------
/_sed.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Description:
4 | # Sed examples with the files in 'text/'
5 | #
6 | # Tutorials:
7 | # - http://www.grymoire.com/Unix/Sed.html
8 | # - http://www.thegeekstuff.com/tag/sed-tips-and-tricks/
9 |
10 | #-===================================================================
11 | # PRINT (p)
12 | # http://www.thegeekstuff.com/2009/09/unix-sed-tutorial-printing-file-lines-using-address-and-patterns/
13 | #
14 | # Syntax:
15 | # sed -n 'ADDRESSp' filename
16 | # sed -n '/PATTERN/p' filename
17 | #-===================================================================
18 | exit
19 |
20 | # Print contents of a file.
21 | sed -n '/fox/p' text/*
22 | sed -n '/Sysadmin/p' text/geek.txt
23 |
24 | # Print a specific line `N`.
25 | sed -n '3p' text/geek.txt
26 |
27 | # Negation. Print every line besides the 3rd line.
28 | sed -n '3!p' text/geek.txt
29 |
30 | # Print lines `3` to `5`.
31 | sed -n '3,5p' text/geek.txt
32 |
33 | # Print lines starting with `3` and skipping by `2`.
34 | sed -n '3~2p' text/geek.txt
35 |
36 | # Print the last line.
37 | sed -n '$p' text/geek.txt
38 |
39 | # Print lines `2` to the last line.
40 | sed -n '2,$p' text/geek.txt
41 |
42 | # Print lines matching the pattern until the specified line.
43 | sed -n '/Sysadmin/,3p' text/geek.txt
44 | sed -n '/Oracle/,5p' text/geek.txt
45 |
46 | # Print lines starting from `3` until it matches the pattern.
47 | sed -n '3,/Sysadmin/p' text/geek.txt
48 |
49 | # Print lines matching the pattern to the last line.
50 | sed -n '/Website/,$p' text/geek.txt
51 |
52 | # Prints the lines matching the pattern and the next '3' lines.
53 | sed -n '/Sysadmin/,+3p' text/geek.txt
54 |
55 | # Prints the lines matching the between the two patterns.
56 | sed -n '/Hardware/,/Website/p' text/geek.txt
57 |
58 |
59 | #-===================================================================
60 | # PRINT LINE NUMBER
61 | # http://www.thegeekstuff.com/2009/11/unix-sed-tutorial-append-insert-replace-and-count-file-lines/
62 | #
63 | # Syntax:
64 | # sed '=' filename
65 | # sed '/PATTERN/=' filename
66 | #-===================================================================
67 |
68 | # Prints the line number for all lines in the file.
69 | sed -n '=' filename
70 |
71 | # Prints the line number that matches the pattern.
72 | sed -n '/Linux/=' filename
73 |
74 | # Prints the line number in range of two patterns (inclusive).
75 | sed -n '/Linux/,/Hardware/=' filename
76 |
77 | # Prints the total number of lines.
78 | sed -n '$=' filename
79 |
80 |
81 | #-===================================================================
82 | # DELETE (d)
83 | # http://www.thegeekstuff.com/2009/09/unix-sed-tutorial-delete-file-lines-using-address-and-patterns/
84 | #
85 | # Syntax (same as print):
86 | # sed 'ADDRESS'd filename
87 | # sed /PATTERN/d filename
88 | #-===================================================================
89 |
90 | # Deletes the nth line from the file.
91 | sed '3d' text/geek.txt
92 |
93 | # Delete every lines starting from 3 and skipping by 2.
94 | sed '3~2d' text/geek.txt
95 |
96 | # Delete lines from 3 to 5.
97 | sed '3,5d' text/geek.txt
98 |
99 | # Delete the last line.
100 | sed '$d' text/geek.txt
101 |
102 | # Delete lines matching the pattern.
103 | sed '/Sysadmin/d' text/geek.txt
104 |
105 |
106 | #-===================================================================
107 | # SUBSTITUTE (s)
108 | # http://www.thegeekstuff.com/2009/09/unix-sed-tutorial-replace-text-inside-a-file-using-substitute-command/
109 | #
110 | # Syntax:
111 | # sed 'ADDRESSs/REGEX/REPLACEMENT/FLAGS' filename
112 | # sed '/PATTERN/s/REGEX/REPLACEMENT/FLAGS' filename
113 | #
114 | # Delimiter:
115 | # '/' can be replaced with any character (;@|-*~) as a delimiter.
116 | #
117 | # Flags:
118 | # -g - replace all instances of REGEX with REPLACEMENT
119 | # -n - replace the nth instance
120 | # -p - print line if a substituion was made
121 | # -i - case-insensitive substituion
122 | # -r - extended regex (preferred)
123 | # -w - write to file if a substituion was made
124 | #-===================================================================
125 |
126 | # Simple substituion for the first result.
127 | sed 's/Linux/Unix/' text/geek.txt
128 |
129 | # Simple substituion for global instances.
130 | sed 's/Linux/Unix/g' text/geek.txt
131 |
132 | # Replace nth instance.
133 | sed 's/Linux/Unix/2' text/geek.txt
134 |
135 | # Write matched lines to output.
136 | sed -n 's/Linux/Unix/gp' text/geek.txt > text/geek-sub.txt
137 |
138 | # Replace parens with square brackets.
139 | sed 's/(/[/g; s/)/]/g' text/geek.txt
140 | sed -r 's/\((.+)\)/\[\1\]/g' text/geek.txt
141 |
142 | # Use & to access the pattern found.
143 | sed -r 's/[0-9]+/ (&) /g' text/numbers.txt
144 |
145 | # Use regex group for capturing additional patterns (up to 9).
146 | sed 's/\(Linux\).\+/\1/g' text/geek.txt
147 | sed -r 's/(Linux).+/\1/g' text/geek.txt
148 |
149 | # Remove parenthesis and everything inside.
150 | sed 's/(.\+)//g' text/geek.txt
151 | sed -r 's/\(.+\)//g' text/geek.txt
152 |
153 | # Remove only the parenthesis.
154 | sed 's/(\(.\+\))/\1/g' text/geek.txt
155 | sed -r 's/\((.+)\)/\1/g' text/geek.txt
156 |
157 | # Replace everything inside parenthesis with YOLO.
158 | sed -r 's/\(.+\)/\(YOLO\)/g' text/geek.txt
159 |
160 | # Remove the last 3 characters.
161 | sed 's/.\{3\}$//g' text/geek.txt
162 | sed -r 's/.{3}$//g' text/geek.txt
163 |
164 | # Remove the last word.
165 | sed -r 's/\d$//g' text/geek.txt
166 |
167 | # Remove all letters.
168 | sed -r 's/[a-zA-Z]//g' text/geek.txt
169 |
170 | # Remove number lists.
171 | sed -r 's/[0-9](\. )?//g' text/geek.txt
172 |
173 | # Remove all alphanumeric characters.
174 | sed -r 's/\w//g' text/geek.txt
175 |
176 | # Removes html tags.
177 | sed 's/<[^>]*>//g' text/html.txt
178 |
179 | # Remove html tags (intermediate).
180 | sed -r 's|(?[a-z]+>)||g' text/html.txt
181 |
182 | # Replace value with parenthesis value.
183 | sed 's/ .\+(\(.\+\))/ \1/g' text/geek.txt
184 |
185 | # Commatize some numbers. Incorrect attempts.
186 | sed -r 's/([0-9]+)([0-9]{3}$)/\1,\2/g' text/numbers.txt
187 | sed -r 's/([0-9]*)([0-9]{3})+([0-9]{3}$)/\1,\2,\3/g' text/numbers.txt
188 |
189 | # Commatize any number. Example with labels and loops
190 | # http://shallowsky.com/blog/linux/cmdline/sed-insert-commas.html
191 | sed ':a;s/\B[0-9]\{3\}\>/,&/;ta' text/numbers.txt
192 | sed -r ':loop; s/\B[0-9]{3}\>/,&/; t loop' text/numbers.txt
193 |
194 |
195 | #-===================================================================
196 | # APPEND (a), INSERT (i), CHANGE (c)
197 | # http://www.thegeekstuff.com/2009/11/unix-sed-tutorial-append-insert-replace-and-count-file-lines/
198 | #
199 | # Syntax:
200 | # sed 'ADDRESSa TEXT' filename
201 | # sed '/PATTERN/a TEXT' filename
202 | #-===================================================================
203 |
204 | # Append examples.
205 | sed '1a hello world' text/geek.txt
206 | sed '/Linux/a TUX' text/geek.txt
207 | sed '$a this is the last line' text/geek.txt
208 |
209 | # Insert examples.
210 | sed '1i this will be inserted before line 1' text/geek.txt
211 |
212 | # Change examples, aka replace.
213 | sed '1c HAS BEEN REPLACED' text/geek.txt
214 | sed -r '/[wW]indows/c HAS BEEN HAXed' text/geek.txt
215 |
216 |
217 | #-===================================================================
218 | # TRANSFORM
219 | #
220 | # Syntax:
221 | # sed 'y/abcd/ABCD/' filename
222 | #-===================================================================
223 |
224 | # Converts all lowercase chars to uppercase.
225 | sed 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' text/geek.txt
226 |
227 | # Converts all uppercase chars to lowercase.
228 | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' text/geek.txt
229 |
230 | # Perform a two character step cipher.
231 | sed 'y/abcdefghijklmnopqrstuvwxyz/cdefghijklmnopqrstuvwxyzab/' text/geek.txt
232 |
233 |
234 | #-===================================================================
235 | # MULTI-LINE OPERATIONS
236 | # http://www.thegeekstuff.com/2009/11/unix-sed-tutorial-multi-line-file-operation-with-6-practical-examples/
237 | #
238 | # The '-e' flag allows for multiple commands.
239 | #-===================================================================
240 |
241 | sed -r -e 's/etc\.*//g' -e 's/(\s+)(\))/\2/g' text/geek.txt
242 |
243 | # Detect consecutive duplicate lines and replace the newline with ' @ '.
244 | # - The curly braces are used to group sed commands.
245 | # - Begin by reading the first line and puts it in N.
246 | # - Then reads the next line separated by a new line (\n) and appends it to N.
247 | # - Lastly perform the substitution.
248 | sed -e '{ N; s/\n/ @ /; }' text/duplicate-geek.txt
249 |
250 |
251 | #-===================================================================
252 | # CONTROL FLOW
253 | # http://www.thegeekstuff.com/2009/12/unix-sed-tutorial-6-examples-for-sed-branching-operation/
254 | #
255 | # Syntax:
256 | # sed ':label command(s) b label'
257 | # sed ':label command(s) t label'
258 | #-===================================================================
259 |
260 | # Commatize numbers.
261 | sed -r ':loop; s/(.*[0-9])([0-9]{3})/\1,\2/; t loop' text/numbers.txt
262 |
--------------------------------------------------------------------------------
/scripts/grades/avg-class-grade.awk:
--------------------------------------------------------------------------------
1 | # awk -f avg-class-grade.awk grades.txt
2 |
--------------------------------------------------------------------------------
/scripts/grades/avg-grade.awk:
--------------------------------------------------------------------------------
1 | # awk -f avg avg-grade.awk grades.txt
2 |
3 | {
4 | total = $3 + $4 + $5;
5 | avg = total / 3;
6 | grade = "C";
7 |
8 | if (avg >= 90) grade = "A";
9 | else if (avg >= 80) grade = "B";
10 | else if (avg >= 70) grade = "C";
11 | else if (avg >= 65) grade = "D";
12 | else grade = "F";
13 |
14 | print $1, "=>", grade;
15 | }
16 |
--------------------------------------------------------------------------------
/scripts/grades/grades.txt:
--------------------------------------------------------------------------------
1 | Jones 2143 78 84 77
2 | Gondrol 2321 56 88 55
3 | RinRao 2122 38 37
4 | Edwin 2537 87 97 95
5 | Dayan 2415 30 47
6 |
--------------------------------------------------------------------------------
/text/duplicate-geek.txt:
--------------------------------------------------------------------------------
1 | Linux Sysadmin
2 | Databases - Oracle, mySQL etc.
3 | Databases - Oracle, mySQL etc.
4 | Security (Firewall, Network, Online Security etc)
5 |
6 |
7 | Storage in Linux
8 | Website Design
9 | Website Design
10 | Windows- Sysadmin, reboot etc.
11 |
--------------------------------------------------------------------------------
/text/employee.txt:
--------------------------------------------------------------------------------
1 | 100 Thomas Manager Sales $5,000
2 | 200 Jason Developer Technology $5,500
3 | 300 Sanjay Sysadmin Technology $7,000
4 | 400 Nisha Manager Marketing $9,500
5 | 500 Randy DBA Technology $6,000
6 |
--------------------------------------------------------------------------------
/text/geek.txt:
--------------------------------------------------------------------------------
1 | 1. Linux - Sysadmin, Scripting etc.
2 | 2. Databases - Oracle, mySQL etc.
3 | 3. Hardware
4 | 4. Security (Firewall, Network, Online Security etc)
5 | 5. Storage
6 | 6. Cool gadgets and websites
7 | 7. Productivity (Too many technologies to explore, not much time available)
8 | 8. Website Design
9 | 9. Software Development
10 | 10. Windows - Sysadmin, reboot etc.
11 | 11. Linux - Sed tricks.
12 |
--------------------------------------------------------------------------------
/text/html.txt:
--------------------------------------------------------------------------------
1 |
2 | The quick brown fox jumps over the lazy dawg.
3 |
4 |
--------------------------------------------------------------------------------
/text/numbers.txt:
--------------------------------------------------------------------------------
1 | 1
2 | 10
3 | 100
4 | 1000
5 | 10000
6 | 100000
7 | 1000000
8 | 10000000
9 | 100000000
10 | 1000000000
11 | 10000000000
12 | 100000000000
13 | 1000000000000
14 |
--------------------------------------------------------------------------------
/text/paths.txt:
--------------------------------------------------------------------------------
1 | /usr/kbos/bin:/usr/local/bin:/usr/jbin:/usr/bin:/usr/sas/bin
2 | /usr/local/sbin:/sbin:/bin/:/usr/sbin:/usr/bin:/opt/omni/bin:
3 | /opt/omni/lbin:/opt/omni/sbin:/root/bin
--------------------------------------------------------------------------------
/text/phones.txt:
--------------------------------------------------------------------------------
1 | (555)555-1212
2 | (555)555-1213
3 | (555)555-1214
4 | (666)555-1215
5 | (666)555-1216
6 | (777)555-1217
--------------------------------------------------------------------------------
/text/table.txt:
--------------------------------------------------------------------------------
1 | rank length text
2 | 1 36 How quickly daft jumping zebras vex.
3 | 2 38 Jackdaws love my big sphinx of quartz.
4 | 3 44 The quick brown fox jumps over the lazy dog.
5 |
--------------------------------------------------------------------------------