I need to modify a script to remove spaces from a csv file.
The csv file is delimited by the '~' character and I need to remove the spaces which appear before this character.
i.e
Sample input:
LQ001 SWAT 11767727 ~9104 ~001 ~NIRSWA TEST 18 ~2 ~Standard Test ~0011
Desired Output:
LQ001 SWAT 11767727~9104~001~NIRSWA TEST 18~2~Standard Test~0011
Am new to shell scripting and have been playing around with the sed
command but with limited success!!
Replace "<spc>" and "<tab>" with literal spaces and tab characters. It will remove any number of whitespace before a tilde ("~") character everywhere on the line.