I've created a script that unloads a file as a comma-delimited txt file (orderfile.txt). The gotcha is that after the last record there is a comma that I need to remove.
IE The comma at the end of the line as shown below.
9,002,7,095,92.0,2318.08,1025.45,
11,899,6,075,0.0,0.0,0.0,
6,002,3,010,91.0,3154.09,1462.5,
I know the SED command is probably the solution but I'm not getting how to format the sed script to do what I'm trying to accomplish. I've read through a gazzillion how-to pages in multiple sites but none of them really explain/show to a total neophyte like me how to put this concept in place.
I think it's supposed to look something like this but this isn't working.
sed -e '$s,\\,,' > newonfile.txt
Thanks in advance
Gina
IE The comma at the end of the line as shown below.
9,002,7,095,92.0,2318.08,1025.45,
11,899,6,075,0.0,0.0,0.0,
6,002,3,010,91.0,3154.09,1462.5,
I know the SED command is probably the solution but I'm not getting how to format the sed script to do what I'm trying to accomplish. I've read through a gazzillion how-to pages in multiple sites but none of them really explain/show to a total neophyte like me how to put this concept in place.
I think it's supposed to look something like this but this isn't working.
sed -e '$s,\\,,' > newonfile.txt
Thanks in advance
Gina