Laden...
nixCraft Linux / UNIX Newsletter |
How to trim leading and trailing white space in bash Posted: 12 Mar 2022 06:31 AM PST So I have this specific use case where I get data in a comma-separated values (CSV) file. I pick up the company name, address, telephone, email, and some other data from that file. Once data is collected, I create a final pdf using a simple script. Unfortunately, data comes with unwanted leading and trailing white spaces in each field. So my final pdf file gets messed up because of those white space. Let us see how to trim leading and trailing white space for a string in Bash running on Linux or Unix machines. Love this? sudo share_on: Twitter - Facebook - LinkedIn - Whatsapp - Reddit The post How to trim leading and trailing white space in bash appeared first on nixCraft. |
You are subscribed to email updates from nixCraft: Linux Tips, Hacks, Tutorials, And Ideas In Blog Format (RSS/FEED). To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google, 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
Laden...
Laden...