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 4 Days Ago   -   Original Discussion by SkySmart
RavinderSingh13 RavinderSingh13 is offline Forum Advisor  
Registered User
 
Join Date: May 2013
Last Activity: 18 November 2017, 9:36 AM EST
Location: Chennai
Posts: 2,670
Thanks: 588
Thanked 1,272 Times in 1,145 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 (4 Days Ago)