1-360-209-5351x1000 | Welcome, Guest Login | View Cart

unique - File filter can sort and unique lines in a file

Your Price: $0.00
In Stock.
Part Number:unique
  • can presort, then unique
  • count unique, count repeated, count input, count output, count adjacent, show config
  • output to file without a redirect
  • ignorecase
  • can unique without sorting with -rda
  • statistics
  • reads entire file nto RAM to process
  • no usable free compilers to make exes with except DJGPP 4.9.0 or 4.6.2
source code only, binaries not compilable because compilers were broken.

#define PROGRAM_VERSION "2.2"
#define PROGRAM_NAME "unique"
#define PROGRAM_DESCRIPTION "text filter to  print unique lines whether they are adjacent or not (choice) with statistics"
void Help(void) {
    std::cout <<
    "Usage: " PROGRAM_NAME " [switches] [filepaths]"<<std::endl<<
    "  [-[-]?|/?|-h[elp]|/h[elp]] this help."<<std::endl<<
    "  [-[-]version|/version] gives version number."<<std::endl<<
    "  [-[-]sc|/sc|show-config|/show-config] show configuration in output."<<std::endl<<
    "  [-[-]i[gnore-case]|/i[gnore-case]] ignore upper and lower case in sorting, searching, and comparison."<<std::endl<<
    "  [-[-]p[re-sort]|/p[re-sort]|-[-]s[ort]|/s[ort]] -s pre-sorts the lines before an optional -u."<<std::endl<<
    "  [-[-]u[niq[ue]]|/u[niq[ue]]|rad|/rad||remove-adjacent-duplicates|/remove-adjacent-duplicates] remove adjacent duplicates only. lines must be presorted with -s. use in place of -u."<<std::endl<<
    "  [-[-]rda|/rda||remove-duplicates-anywhere|/remove-duplicates-anywhere] remove duplicates anywhere they are found. lines are kept in order and duplicates are eliminated in-place."<<std::endl<<
    "  [-[-]ca|/ca|-[-]count-adjacents|/count-adjacents] counts adjacents."<<std::endl<<
    "  [-[-]cu|/cu|-[-]count-unique|/count-unique] outputs unique lines only with line counts. -u required, -presort is up to user."<<std::endl<<
    "  [-[-]cr|/cr|-[-]count-repeated|/count-repeated] count the number of repeated (group>=2) lines."<<std::endl<<
    "  [-[-]ci|/ci|-[-]count-input-lines]|/count-input-lines] count input source lines."<<std::endl<<
    "  [-[-]co|/co|-[-]count-output-lines]|/count-output-lines] count output source lines."<<std::endl<<
    "  [-[-]o[utput]|/o[utput] filepath] redirect output to filepath or - for stdout."<<std::endl<<
    "  [-[-]write-same-file] Rewrites same source file. Reporting and config appears in file if specified. It might not be good if you use -sc or counting switches with this because that appears in the file as well."<<std::endl<<
    "  [filepath|-] Filepath - is stdin."<<std::endl<<
    "- --cu is in the format filename#COUNT:number:duplicateLine (this format has changed from ambiguous [duplicateLine]:count)"<<std::endl<<
    "- --cu either may be used with any combination of -s and -u."<<std::endl<<
    "- --sort and --unique may be used in any combination."<<std::endl<<
    "- --sort is performed before --unique if both are done."<<std::endl<<
    "- --o and -write-same-file are mutually exclusive, meaning you can have one or the other but not both. they have different kinds of output."<<std::endl<<
    "- --write-same-file and --output are NOT mutually exclusive - if both are turned on, it will replace the original file and will write to file specified by -output."<<std::endl<<
    "- The files' contents are processed in memory.  There 32-bit version MAY have either a 2GiB or4GiB limit (probably less than that)."<<std::endl<<
    "- Redirection of output to a single output file: if multiple input filepaths are specified, output will be merged."<<std::endl<<
    "- Processing is done in-RAM and takes at least 3x filesize. Errors written to stderr. help and version written to stdout."<<std::endl<<
    "Examples as filter:"<<std::endl<<
    "Example: " PROGRAM_NAME " -cr<filein>fileout (count repeated lines)"<<std::endl<<
    "Example: " PROGRAM_NAME " -ci<filein (count input lines)"<<std::endl<<
    "Example: type filein|" PROGRAM_NAME ">fileout (do nothing to input)"<<std::endl<<
    "Example: type filein|" PROGRAM_NAME " -cr -s -u>fileout (presorts, uniques, counts repeated lines)"<<std::endl<<
    "Example: type filein|" PROGRAM_NAME " -s -u>fileout (presorts, uniques)"<<std::endl<<
    "Example: " PROGRAM_NAME " -s -u --write-same-file fileinout1 fileinout2 (presorts, uniques, rewrites 2 input files)"<<std::endl<<
    "Example: " PROGRAM_NAME " -s -u ->fileout (presorts, uniques, stdin input and fileout output)"<<std::endl<<
    "Example: type filein|" PROGRAM_NAME " -s -u>fileout (same as above)"<<std::endl<<
    "Examples as utility:"<<std::endl<<
    "Example: " PROGRAM_NAME " -i -cu -ca -cr -s -u filein -output fileout (process filein in ignorecase mode, presort, unique, count repreated,count total lines, output to fileout)"<<std::endl<<
    "1992 Jim Michaels."<<std::endl;

Related Items