-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex support for reorder
verb
#1325
Comments
An option is to rename the columns if you know the column position, See
Processing
|
reorder
verb
Thanks for adding this in v6.11! Test file: reorder_regex_test_2.csv I'm testing regex support for the reorder verb, and noticing unexpected behavior. For the attached file, why does this give the expected results: but this doesn't: (changing the -f to -r) In the second expression, column order of the results is 'bbb_aaa' 'aaa_aaa' 'ccc_aaa' I tried this first and also had unexpected results: ..with results in a similar column order... Providing just one regex expression seems to work fine however: Am I using incorrect syntax to combine the regex fields? Apologies if I'm missing something obvious. |
Would it be possible to allow regex matching when reordering column headers of a csv file?
The documentation describes reorder as requiring the specific field names, e.g.,
"i"
and"b"
inmlr --opprint reorder -f i,b data/small
My use case is that I don't necessarily know the exact field names, but I know that some will start with prefix XXX and other with YYY, and I would like to be able to reorder so that any (or 0) fields starting with YYY come first, followed by any (or 0) that start with XXX.
Thanks!
The text was updated successfully, but these errors were encountered: