Can anyone tell me how I can make a substitution on one field only. My input file consists of rows like:
"69500 - 69524","00561000.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69500 - 69524"
"69525","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69525"
"792265","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69525"
"69531","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69531"
"792696 792697 792698 792699","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69544"
"792334","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69552"
"69553","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69553"
"792707 792708","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69553"
"792709","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69553"
I want all spaces in field 1 (fields separated by commas) to be changed into underlines, but all other spaces in the file to remain unchanged.
I'm assuming awk is the best way to do this - I know I could do it by splitting the file into 2, 1 for field 1, the other for the rest, sed-ding file 1 & paste-ing them back together but there must be more efficient way.
Hope someone can help
Chris
"69500 - 69524","00561000.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69500 - 69524"
"69525","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69525"
"792265","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69525"
"69531","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69531"
"792696 792697 792698 792699","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69544"
"792334","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69552"
"69553","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69553"
"792707 792708","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69553"
"792709","00561001.TIF","\\NAME OF SERVER\Z\xyz","Paybill048\69553"
I want all spaces in field 1 (fields separated by commas) to be changed into underlines, but all other spaces in the file to remain unchanged.
I'm assuming awk is the best way to do this - I know I could do it by splitting the file into 2, 1 for field 1, the other for the rest, sed-ding file 1 & paste-ing them back together but there must be more efficient way.
Hope someone can help
Chris