Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gorimaaa/LineOccurences

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 

Repository files navigation

LineOccurences

This project aims to search for occurences in files, there are two type of usage :

  • First usage : 1 file is given in parameter, in this case the lines that have at least 2 occurences are displayed like this : X, Y, Z, ... TEXT_LINE where X, Y, Z are the line numbers where TEXT_LINE appear.
  • Second usage : 2 files or more are given, this time the program displays the lines that appear at least one time in each files : X, Y, Z, ... TEXT_LINE where X, Y, Z are the occurences of TEXT_LINE in each file.

Build and Execute instructions

A makefile is doing the build
Go to the LineOccurences directory

cd LinesOccurences
cd lnid_test
make
./lnid [OPTIONS] FILE_1 FILE_2 ...

Options

We can add options to our search, they are specified in the helper :

./lnid --help
#  Usage: ./lnid [OPTIONS] FILE [OTHER_FILES]
#  LIST OF OPTIONS :
#    -f CLASS or --filter=CLASS : Display lines where the characters respect
#              the function CLASS, CLASS being a function from
#              <ctype.h> such as isalpha, isalnum...
#  
#   -s WORD or --sort=WORD : Display the sorted lines according to WORD,
#          if WORD=standard we use the strcmp function
#          if WORD=locate we use the strcoll function
#
#   -u or --uppercasing : Converts each line to uppercase
#  
#  2 TYPES OF USAGE:
#   FIRST TYPE : You can choose options and the put a file, an example:
#   ./lnid -f isalpha -s locale test.txt, then we will display the lines
#       that occur at least two times followed by the line, an example of
#   display: 110,55-->football
#
#   SECOND TYPE : You chan choose options and then put multiple files, 
#   an example: ./lnid -s standard --uppercasing test1.txt test2.txt, 
#   then we will display the lines that occur at least one time in each 
#   file given, an example of display : 1-->2-->baseball

Examples of usage

TODO

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published