Skip to content

Search .xml and .ditamap files for the word <search-text>. During the search, exclude from the results instances where <search-text> is immediately preceded by any <exclusion-text>. Store the search results in a CSV file.

License

Notifications You must be signed in to change notification settings

DwainBlazej/search-xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

search-xml

Search .xml and .ditamap files for the word <search-text>. During the search, exclude from the results instances where <search-text> is immediately preceded by any <exclusion-text>. Store the search results in a CSV file.

Usage

ruby search-xml [options] <search-text> <prefix-exclusion-text> [<prefix-exclusion-text>...]

Options:

--column-separator=UNIQUE: Character or string of characters used to separate columns in the output. Default: |
-o, --csv-output=FILE: The file to output results, in CSV format, into. Default: search-xml.csv
-d, --directory=DIRECTORY: The directory to start the search in. Defaults to the directory this command is run in.
--no-show-relative-path: Report the file names using their full path. Defaults to showing paths relative to the current directory.
-p, --progress: Show the name of the file currently being searched.

Common options:

-q, --verbose: Show results as they are found.
--version: Show version message.
-h, --help: Show this message.

Examples:

To report XML elements containing "workbench", except if the word before "workbench" is "translation":
ruby search-xml workbench translation

To report XML elements containing "workbench", except if the word before "workbench" is either "translation" or "wood":
ruby search-xml workbench translation wood

To report XML elements containing "workbench" without restricting what it's preceded by (in a directory that you're pretty sure doesn't contain any occurences of zzzzzzzzzzzzzzzzzzzzzzzzz workbench):
ruby search-xml workbench zzzzzzzzzzzzzzzzzzzzzzzzz

About

Search .xml and .ditamap files for the word <search-text>. During the search, exclude from the results instances where <search-text> is immediately preceded by any <exclusion-text>. Store the search results in a CSV file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages