A command line utility for file concatenation, featuring:
- Accepts input files from either
STDINor arg-i. - Writes concatenation result to either
STDOUTor a specific file given by arg-o. - Allows you to skip unwanted contents of each source from either start or end.
- Allows you to fill some paddings before, between and/or after each source.
- Allows you to force the presence of ending newlines after each source.
See fcc --help for more help information on how to use this command line utility. And if you want a rust library that provides similar functionalities, see admerge.
Assumes we have three text files 1.txt, 2.txt and 3.txt in current working directory.
The content of 1.txt is:
111 112 113
121 122 123
131 132 133The content of 2.txt is:
211 212 213
221 222 223
231 232 233The content of 3.txt is:
311 312 313
321 322 323
331 332 333find [1-3].txt | fccor
echo [1-3].txt | fccor
fcc -i 1.txt 2.txt 3.txtwill print the following text to stdout
111 112 113
121 122 123
131 132 133211 212 213
221 222 223
231 232 233311 312 313
321 322 323
331 332 333echo [1-3].txt | fcc -nwill print the following text to stdout:
111 112 113
121 122 123
131 132 133
211 212 213
221 222 223
231 232 233
311 312 313
321 322 323
331 332 333
echo [1-3].txt | fcc -n --skip-head=1 --skip-tail=1will print the following text to stdout:
121 122 123
221 222 223
321 322 323
echo [1-3].txt | fcc -n --headoncewill print the following text to stdout:
111 112 113
121 122 123
131 132 133
221 222 223
231 232 233
321 322 323
331 332 333
echo [1-3].txt | fcc -n --padding="padding between
"will print the following text to stdout:
111 112 113
121 122 123
131 132 133
padding between
211 212 213
221 222 223
231 232 233
padding between
311 312 313
321 322 323
331 332 333
Binaries for Windows, Linux and macOS are available from Github.
You can also compile the binary from source using Cargo:
git clone git://github.com/mapkts/fcc
cd fcc
cargo build --releaseCompilation will probably take a few minutes depending on your machine. The
binary will end up in ./target/release/fcc.
fcc is distributed under the terms of either the MIT license or the Apache License (Version 2.0).
See the LICENSE-APACHE and LICENSE-MIT files in this repository for more information.