Groups
Sign in
Groups
csvfix
Conversations
About
Send feedback
Help
Cut substring from a field?
23 views
Skip to first unread message
marcde...@gmail.com
unread,
Oct 29, 2016, 1:04:48 PM
10/29/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to csvfix
Is it possible to cut a substring from a field,
e.g. substring 1 to 3 from field 2?
Please excuse if the answer is listed in the
help file, I haven't read every topic yet.
Thank you.
Neil Butterworth
unread,
Oct 29, 2016, 1:10:31 PM
10/29/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to csvfix
Yes, use the substr() function in the expression language with commands like eval. See
http://neilb.bitbucket.org/csvfix/manual/csvfix16/ExpressionLanguage.html
In your case this would be the call to use:
substr( $2, 1, 3 )
marcde...@gmail.com
unread,
Oct 29, 2016, 2:52:20 PM
10/29/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to csvfix
Hi Neil,
great, thank you very much. I have done it successfully with csvfix eval -e "substr($2,1,3)"
Regards,
Marc
Reply all
Reply to author
Forward
0 new messages