A compact CLI tool for text transformations, making complex operations intuitive.
Very much a work in progress. Expect frequent changes and breaking changes. Expected unexpected behavior.
git clone https://github.com/yourusername/flo.git
cd flo && roc buildcat input.txt | flo [options -] action1 arg1 - action2 arg2 ...
Options: --help, --debug
Flo simplifies complex text transformations that would otherwise require multiple commands:
Without flo:
cat data.csv | cut -d',' -f2 | sed 's/^ *//' | sed 's/ *$//' | sort | uniqWith flo:
cat data.csv | flo split "," - keep-cols 1 - trim - sort - uniqWithout flo:
grep "ERROR" logs.txt | sed 's/^.*\[//' | sed 's/\].*$//' | sortWith flo:
cat logs.txt | flo grep "ERROR" - strip-left "[" - strip-right "]" - sortWithout flo:
cat items.txt | sort | uniq | sed 's/^/- /'With flo:
cat items.txt | flo sort - uniq - col-prepend "- "- keep-rows
Norstart:end: Keep specific rows - keep-cols
Norstart:end: Keep specific columns - dup: Duplicate each line
- trim: Remove whitespace from line ends
- strip-left/right
str: Remove specified string from start/end - col-append/prepend
str: Add text to end/start of each line - sort: Sort lines alphabetically
- uniq: Remove consecutive duplicates
- split
delimiter: Split lines on delimiter - grep
pattern: Filter lines containing pattern
See transformation steps:
echo "a,b,c" | flo --debug split "," - trim
echo " a,b,c" | flo --debug - split "," - trimOutput:
Input:
a,b,c
Then: (Split ","):
a
b
c
Then: Trim:
a
b
c