How to remove trailing spaces from a variable?

I am getting a value from a csv file using CUT command, however the command extracting the records with trailing spaces. I am using the result into a sql session to fetch data, because of the trailing spaces the sql session is unable to fetch any data.
Please let me know, how to remove this trailing space.

Maybe with sed:

cut ... | sed 's/ *$//'
1 Like

see: