Unix/Linux Go Back    



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 Unix and Linux 11-14-2017   -   Original Discussion by SkySmart
RavinderSingh13's Unix or Linux Image
RavinderSingh13 RavinderSingh13 is offline Forum Advisor  
Registered User
 
Join Date: May 2013
Last Activity: 11 April 2018, 7:35 AM EDT
Location: Chennai
Posts: 2,715
Thanks: 609
Thanked 1,298 Times in 1,165 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)