A tool to transform unstructured text to csv by regular expression.
If input is (test.txt)
test=abc&foo=bar1
test=def&foo=bar2
test=efg&foo=bar3
Issue this command
pq -R 'test=(?<test>[a-zA-z]*)&foo=(?<foo>[a-zA-z]*)' -c test,foo test.txt
then output will be
abc,bar
def,bar
efg,bar
In the regular expression, we define two groups 'test', 'foo'. And we translate the group to csv columns.
usage: pq -R <regular-expression> -c <columnlist> [<file> ...]
-c <arg> column list. Separated by comma
-g <arg> group by list. Separated by comma
-H with CSV header
-P <arg> level of parallelism
-R <arg> the regular expression with groups
Please download the binary from the release tag.
brew update
brew untap tenmax/azure
brew tap tenmax/azure
brew install pq
This tool is powered by poppy