×
UNIX.COM Login
Username:
Password:  
Show Password






👤


Replace space within quotes

Shell Programming and Scripting




Kindly Note - This is a Single User Post by Forum Member RavinderSingh13 Regarding:
Replace space within quotes.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old 11-14-2017
RavinderSingh13 RavinderSingh13 is offline Forum Advisor  
Registered User
 
Join Date: May 2013
Last Activity: 16 July 2018, 12:49 PM EDT
Location: Chennai
Posts: 2,750
Thanks: 623
Thanked 1,316 Times in 1,183 Posts
Hello SkySmart,

Could you please try following and let me know if this helps.(test with only provided sample).


Code:
echo '/var/FTPROOT/px/sci/archive/20171102070057904-DY_DC04_Daily Inventory Sync-en-us.csv' '/var/FTPROOT/px/sci/archive/20171102070058291-DY_DC07_Daily Inventory Sync-en-us.csv' | awk -v RS=" /" -F"/" '{gsub(/ /,"*",$NF);print}' ORS=" /" OFS="/"
OR
echo '/var/FTPROOT/px/sci/archive/20171102070057904-DY_DC04_Daily Inventory Sync-en-us.csv' '/var/FTPROOT/px/sci/archive/20171102070058291-DY_DC07_Daily Inventory Sync-en-us.csv' |
awk -v RS=" /" -F"/" '{gsub(/ /,"*",$NF);print}' ORS=" /" OFS="/"

Thanks,
R. Singh
The Following User Says Thank You to RavinderSingh13 For This Useful Post:
SkySmart (11-14-2017)