49 lines
1.2 KiB
Markdown
49 lines
1.2 KiB
Markdown
# fexcel
|
||
|
||
A simple command-line tool to sanitize invalid UTF-8 sequences from input streams.
|
||
|
||
## Overview
|
||
|
||
`fexcel` reads data from stdin, replaces any invalid UTF-8 sequences with the Unicode replacement character (<28>), and writes the sanitized output to stdout. This is particularly useful when working with files that may contain mixed or invalid encodings, such as Windows-exported CSV files.
|
||
|
||
## Installation
|
||
|
||
```bash
|
||
mise run install # or
|
||
cargo install --path . --force
|
||
```
|
||
|
||
Or build from source:
|
||
|
||
```bash
|
||
cargo build --release
|
||
```
|
||
|
||
The binary will be available at `target/release/fexcel`.
|
||
|
||
## Usage
|
||
|
||
Use `fexcel` as a pipe filter to clean input before passing it to tools that require valid UTF-8:
|
||
|
||
```bash
|
||
cat my-windows-exported.csv | fexcel | csvlens
|
||
```
|
||
|
||
Without `fexcel`, tools like `csvlens` may fail with invalid UTF-8 errors. By piping through `fexcel` first, you can safely view and process files with encoding issues.
|
||
|
||
### Additional Examples
|
||
|
||
Clean a file and save the output:
|
||
```bash
|
||
cat problematic-file.txt | fexcel > cleaned-file.txt
|
||
```
|
||
|
||
Use with any UTF-8 sensitive tool:
|
||
```bash
|
||
cat messy-data.log | fexcel | grep "pattern"
|
||
```
|
||
|
||
## License
|
||
|
||
See LICENSE file for details.
|