README
¶
chars
Determine the end-of-line format, tabs, bom, and nul characters
Download
Binaries for Windows, MacOS, Linux and FreeBSD are provided on the releases page.
Usage
chars v1.2.0
Determine the end-of-line format, tabs, bom, and nul
https://github.com/jftuga/chars
Usage:
chars [file-glob 1] [file-glob 2] ...
-b examine binary files
-e string
exclude based on regular expression; use .* instead of *
-l int
shorten files names to a maximum of the length
Notes:
Also try: chars * -or- chars */* -or- chars */*/*
Example 1
- Run
charswith no additional cmd-line switches -
- Only report files in the current directory
-
- Report text files only since
-bis not used
- Report text files only since
PS C:\chars> .\chars.exe *
+-----------------+------+------+------+--------+------+-------+
| FILENAME | CRLF | LF | TAB | NUL | BOM8 | BOM16 |
+-----------------+------+------+------+--------+------+-------+
| .gitignore | 0 | 16 | 0 | 0 | 0 | 0 |
| .goreleaser.yml | 0 | 59 | 0 | 0 | 0 | 0 |
| LICENSE | 0 | 21 | 0 | 0 | 0 | 0 |
| README.md | 0 | 23 | 0 | 0 | 0 | 0 |
| cmd.go | 0 | 148 | 148 | 0 | 0 | 0 |
| go.mod | 0 | 7 | 0 | 0 | 0 | 0 |
| go.sum | 0 | 4 | 0 | 0 | 0 | 0 |
| testfile1 | 19 | 19 | 0 | 0 | 0 | 0 |
| testfile2 | 0 | 21 | 0 | 2269 | 0 | 1 |
+-----------------+------+------+------+--------+------+-------+
Example 2
- Run
charswith-eand-lcmd-line switches -
- Only report files starting with
pin theC:\Windows\System32directory
- Only report files starting with
-
- Exclude all files matching
perf.*dat
- Exclude all files matching
-
- Shorten filenames to a maximum length of
32
- Shorten filenames to a maximum length of
PS C:\chars> .\chars.exe -e perf.*dat -l 32 C:\Windows\System32\p*
+----------------------------------+------+------+-----+------+------+-------+
| FILENAME | CRLF | LF | TAB | NUL | BOM8 | BOM16 |
+----------------------------------+------+------+-----+------+------+-------+
| C:\Windows\System32\pcl.sep | 11 | 11 | 0 | 0 | 0 | 0 |
| C:\Windows\System32\perfmon.msc | 1933 | 1933 | 0 | 0 | 0 | 0 |
| C:\Windows\Sys...tmanagement.msc | 1945 | 1945 | 0 | 0 | 0 | 0 |
| C:\Windows\System32\pscript.sep | 2 | 2 | 0 | 0 | 0 | 0 |
| C:\Windows\Sys...eryprovider.mof | 0 | 61 | 0 | 2073 | 0 | 1 |
+----------------------------------+------+------+-----+------+------+-------+
Wikipedia
- Newline -
CRLFvsLF - Tab key
- Null character
- Byte order mark -
BOM-8vsBOM-16
Acknowledgments
- ellipsis - Go module to insert an ellipsis into the middle of a long string to shorten it
- tablewriter - ASCII table in golang
Documentation
¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.