Sample Header Ad - 728x90

Convert lower-case to uppercase with the output to a new column using miller

0 votes
3 answers
342 views
I want to copy column NAME to column NAME-LOWERCASE. NAME-LOWERCASE should only contain lowercase letters. The uppercase should be untouched in all column expect NAME-LOWERCASE input
NAME,test
PTC,N
Agri,Y
E-example,N
ForYou,N
Willy Nes,Y
output
NAME,NAME-LOWERCASE,test
PTC,ptc,N
Agri,agri,Y
E-example,E-example,N
ForYou,foryou,N
Willy Nes,willy nes,Y
I know how to create a new column from another column and reorder
mlr -I --csv \
    put '$FIRSTNAME = sub($FULLNAME," .*","")' then \
    reorder -f FULLNAME,LASTNAME,EMAIL,DOMAIN,COMPANY input.csv
And I know how to convert upper to lowercase
mlr --csv -N case -l
How to combine both commands? Or there is another miller command to reach my goal?
Asked by pwrsheller (357 rep)
Sep 19, 2023, 07:04 AM
Last activity: Oct 11, 2023, 01:38 PM