Last word substitution

Ok this is last question of the day from my side .
I have this file and I want to replace the last letter " , " with " ) " .
The input file is

#cat zip.20080604.sql
CONNECT TO TST103 ;
SET SESSION_USER OPSDM001 ;
SET CURRENT SCHEMA OPSDM001 ;
CREATE VIEW OPSDM001.vw_zip SELECT (
ZIP_CD ,
ZIP_TYP_SRC_CD ,
ZIP_TYP_CD ,
ZIP_ROW_END_DT ,
ZIP_ROW_EFF_DT ,
ZIP_LST_2_CD ,
ZIP_FST_3_CD ,
UPDT_DT WITH
ST_NUM_CD ,
ST_ABBR_CD ,
PST_CNTY_NM ,
PST_CNTY_CD ,
LOAD_DT WITH
HCFA_CNTY_NM ,
HCFA_CNTY_CD ,
CTY_NM ,

Desired output is

#cat zip.20080604.sql
CONNECT TO TST103 ;
SET SESSION_USER OPSDM001 ;
SET CURRENT SCHEMA OPSDM001 ;
CREATE VIEW OPSDM001.vw_zip SELECT (
ZIP_CD ,
ZIP_TYP_SRC_CD ,
ZIP_TYP_CD ,
ZIP_ROW_END_DT ,
ZIP_ROW_EFF_DT ,
ZIP_LST_2_CD ,
ZIP_FST_3_CD ,
UPDT_DT WITH
ST_NUM_CD ,
ST_ABBR_CD ,
PST_CNTY_NM ,
PST_CNTY_CD ,
LOAD_DT WITH
HCFA_CNTY_NM ,
HCFA_CNTY_CD ,
CTY_NM )

Thanks ,

sed -i '$s/,/)/' zip.20080604.sql

Thanks a lot !

can you please tell me what is the significance of "-i" option in the command.???

i tried to find out but failed to get any info from net. :frowning:

Some versions of sed allow you to do edits in the file itself, without saving to a temporary file and then moving it back over the original file. Probably your sed doesn't have this option.

Please start a new thread if you have a tangential question.