I have a csv file and the lines have different length. But all of them ends with a number surrounded by a pair of braces. For example,........{5}........{16}I'd like to remove the number and the braces or maybe replace them for double quotes, for example. The result could be................or ................I only found solution for lines with fixed length or with the same string at the end of line.Any idea?
Trim last chars from a line
shell script;string;csv
To remove, with GNU sed:sed 's/{[0-9]\+}$//' file.csvThe standard equivalent:sed 's/{[0-9]\{1,\}}$//' file.csvOr:sed 's/{[0-9][0-9]*}$//' file.csvReplace // with // if you want to replace with  instead of deleting.