Skip to content

cartcrom/C-Grep-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unix Grep Command Implementation

  • Lists occurrences of a given word found in a given file
  • Uses linked-lists of linked-lists to store multiples occurences of the word on the same line

How to compile:

gcc myGrep.c wordList.c wordList.h

  • Flags used during development: -Wall -Werror -ansi -pedantic

How to Run:

./a.out <word> <filename>

Sample Run:

./a.out the sample.txt
  • ./a.out the sample.txt
  • Longest line (50 characters): Polyana, in the province of Tula. His mother died
  • Number of lines: 17
  • Total occurrences of "the": 7
  • Line 1, word(s) 4: August 28, 1828, at the family estate of Yasnaya
  • Line 2, word(s) 2: Polyana, in the province of Tula. His mother died
  • Line 4, word(s) 2: Placed in the care of his aunts, he passed many
  • Line 7, word(s) 1, 7: entered the university. He cared little for the
  • Line 11, word(s) 4: English, and Russian novels, the New Testament,
  • Line 12, word(s) 6: Voltaire, and Hegel. The author exercising the

About

Grep Implementation using Linked Lists

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages