Sponsored Content
Full Discussion: replace %20 in xml file
Top Forums UNIX for Dummies Questions & Answers replace %20 in xml file Post 302512309 by fpmurphy on Saturday 9th of April 2011 11:03:21 AM
Old 04-09-2011
sed is not really suitable for decoding an encoded URL string.

Scripting languages such as Perl, Python and Ruby have modules for encoding and decoding URLs.

For example
Code:
!/usr/bin/perl

use URI::Escape;

my $string = "/Users/imac1/Music/iTunes/iTunes%20Media/Music/The%20Rolling%20Stones/Forty%20Licks%20%5BDisc%202%5D/2-13%20Keys%20To%20Your%20Love.mp3";
my $decode = uri_unescape($string);

print "Original string: $string\n";
print "Decoded  string: $decode\n";

Code:
$ ./demo.pl
Original string: /Users/imac1/Music/iTunes/iTunes%20Media/Music/The%20Rolling%20Stones/Forty%20Licks%20%5BDisc%202%5D/2-13%20Keys%20To%20Your%20Love.mp3
Decoded string: /Users/imac1/Music/iTunes/iTunes Media/Music/The Rolling Stones/Forty Licks [Disc 2]/2-13 Keys To Your Love.mp3

This User Gave Thanks to fpmurphy For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

serach and replace file name in the path in a remote xml file

hi every one , here is my problem !! i have to run my script from an account and update the result in a xml file located on a different account. i use existing ssh keys to do it remotely for example the tags looks like this <PropertyValueList... (1 Reply)
Discussion started by: kiranreddy1215
1 Replies

2. Shell Programming and Scripting

replace nth value in xml file

Hi all, I have application.xml file with following content <dependency> <groupId>fr.orange.portail.ear</groupId> <artifactId>_AdminServicesEAR</artifactId> <version>1.0.0-20080521.085352-1</version> <type>ear</type> </dependency> <dependency> ... (4 Replies)
Discussion started by: subin_bala
4 Replies

3. Shell Programming and Scripting

Search for word in a xml file and replace it with something else

Hello Unix Users, I am very new to Unix so I am not sure how do I do the following. I need a script such that when I type the following in the command prompt > . scriptName.sh wordToBeReplaced DirectoryLocation will find the word someword located in a somefile.xml in DirectoryLocation... (8 Replies)
Discussion started by: 5211171
8 Replies

4. Shell Programming and Scripting

Search and replace in xml file using awk..

Hi All, I have xml file,i am tring to use awk to search pattern as: <Password>x</Password> and Replace with: <Password>y</Password> please any one can help to solve this using awk and awk only. (4 Replies)
Discussion started by: islam2666
4 Replies

5. Shell Programming and Scripting

How can i use sed to replace a keyword in an xml file?

Hello Unix gurus! I'm a unix newbie. Can I use sed to replace a keyword in an xml file and convert this keyword with an output of a unix cat command? for example: <test>keyword</test> and temp.txt = hello! I would like to replace "keyword" with the output of "cat temp.txt". I think... (6 Replies)
Discussion started by: 4dirk1
6 Replies

6. Shell Programming and Scripting

Find/Replace in XML file

I am not sure how to approach this find/replace using a shell script. Any help or guidance appreciated. I want to find this: <objects/> <thumb>thumb_0001.jpg</thumb> <preview>preview_0001.jpg</preview> And replace with something like this: <objects>... (1 Reply)
Discussion started by: jimraynor
1 Replies

7. Shell Programming and Scripting

Need to replace particular content in a xml file

Hi, My requirement is to find a text and replace it with another in a XML file. I am new to Unix,Please provide some suggestion to achieve. Find: <Style ss:ID="ColumnHeader1"> Replace with: <Style ss:ID="ColumnHeader1"> <Borders> <Border ss:Position="Bottom"... (4 Replies)
Discussion started by: cnraja
4 Replies

8. Shell Programming and Scripting

Replace the .txt file between two strings in XML file

Hi i am having XML file with many number of lines,I need to replace between two strings with .txt file using awk. For ex <PersonInfoShipTo ------------------------------ /> My requirement is to replace the content between <PersonInfoShipTo ------------------------------ /> help me. Thanks... (9 Replies)
Discussion started by: Padmanabhan
9 Replies

9. Red Hat

How to replace Ip address in .xml file through shell script?

I have one .xml file. which contains the following line. <ParamString StringId="PortAddress" StringValue="172.27.166.170" /> <ParamString StringId="PortAddress" StringValue="172.27.166.171" /> <ParamString StringId="PortAddress" StringValue="172.27.166.202" /> <ParamString... (9 Replies)
Discussion started by: Anjan Ganguly
9 Replies

10. Shell Programming and Scripting

Replace a string in a xml file

Hello, I have below xml file, I want to find line default-value and replace the string within quotes followed by default-value "moni/Websphere/". Replace moni/Websphere/ with monitor/AMQ/ <monitor> <name>WebsphereMqMonitor</name> <type>managed</type> <argument... (4 Replies)
Discussion started by: prince1987
4 Replies
FORKED-DAAPD(8) 					      RSP & DAAP media server						   FORKED-DAAPD(8)

NAME
mt-daapd - RSP & iTunes-compatible DAAP server SYNOPSIS
forked-daapd [options] DESCRIPTION
forked-daapd is an RSP (Roku Streaming Protocol) and DAAP (Digital Audio Access Protocol) server. It allows you to share your music collec- tion over the local network using the RSP protocol used by devices from Roku and/or the DAAP protocol also used by Apple's iTunes. OPTIONS
-d level Log level (0-5). -D dom,..,dom Debug domains; available domains are: config, daap, db, httpd, main, mdns, misc, rsp, scan, xcode, event. -s Synchronous logging; logging is asynchronous by default. Use when debugging, especially if debugging a crash. -c file Use file as the configuration file. -P file Write PID to file. -f Run in the foreground. -b ffid ffid to be broadcast in mDNS records. -v Display version information. FILES
/etc/forked-daapd.conf /var/cache/forked-daapd AUTHORS
forked-daapd was written by Julien BLACHE <jb@jblache.org> as a fork/rewrite of mt-daapd. mt-daapd was written by Ron Pedde <ron@pedde.com>. This manual page was written by Rogerio Brito <rbrito@users.sf.net> and Julien BLACHE <jblache@debian.org> for the Debian project (but may be used by others). forked-daapd 2010-07-18 FORKED-DAAPD(8)
All times are GMT -4. The time now is 02:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy