Skip to content
This repository was archived by the owner on Nov 7, 2020. It is now read-only.

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
srish committed Aug 6, 2013
1 parent b0daa1e commit 4f43129
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions logs/README
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
Filtering content from the log file
===================================

- cat filename.txt| grep regex | cut -d ':' -f 7
cat filename.txt| grep regex | cut -d ':' -f 7
----------------------------------------------

Combination of cat, grep and cut command is used to filter data from a log file.
Cat command opens file and outputs its content to pipe '|'. After that grep reads from pipe and tries to match with
the regular expression regex in the file. Cut command looks for a character following the delimiter (-d) in the
file and removes sections from each line of files.
- Combination of cat, grep and cut command is used to filter data from a log file.
Cat command opens file and outputs its content to pipe '|'. After that grep reads from pipe and tries to match with
the regular expression regex in the file. Cut command looks for a character following the delimiter (-d) in the
file and removes sections from each line of files.


- To further filter the content, file can be opened with vim editor and regex command can be applied.
Regular Expression :%s//}g
--------------------------

- To further filter the content, file can be opened with vim editor and regex command can be applied.

Regular expression used to retrieve chat data : :%s//}g
Regular expression used to retrieve chat data : :%s//}g

This expression looks for a '}' character in the entire file and wherever it finds a character matching
similar regular expression it removes it from the file.
This expression looks for a '}' character in the entire file and wherever it finds a character matching
similar regular expression it removes it from the file.

0 comments on commit 4f43129

Please sign in to comment.