Bakunin: bash version is 4.2.37(1)-release running on Crunchbang 11
Disedorgue: running that did nothing but create the backup file. The file which should have been changed was identical to the original. Perhaps it's because the xml contains more than the snippet I included here?
Here is an actual line from the xml in question (I broke the line for easier reading, but it's a single line of xml):
and the goal is to transform it into this:
In this case, all I'm really doing is modifying a user profile path from a windows 7 format to a windows xp format, for an application that's run on a virtualized windows xp instance. Possibly also important is the fact that some of the path may have varying spaces... i.e. "ReplacementSample.ext" might be "Replacement Sample.ext" etc, but they will be consistent from old to new.
(Worst case I can just manually regex the changes before I send the configurations to the virtualized WinXP machine, but was hoping for an easy way to just trigger a script to do the translation/replacement because it'll be a frequently repeated procedure and the less manual text-editing the better.)
Ok,
Could you test this case:
file format of trans_old_to_new:
input file:
and command to test (with resultat at home):
Beware: "trans_old_to_new" file mustn't a dos file but an unix file.
PS: in sed, the best separator is the carriage return (\n) because it's always the line terminator for sed.
Regards.
Last edited by disedorgue; 02-08-2015 at 05:32 AM..
Hi Friends,
I looked up online, but couldn't figure out a proper solution.
I have an input file where the columns are separated by multiple spaces and the column content is separated by single space.
For example,
Chr1 hello world unix is fun
In the above example, chr1 is first... (3 Replies)
How to catch a two word keyword which may contain a new line(may include spaces or tab) in it.
for example there is a file a.txt.
$more a.txt
create view
as
(select from
.........
..........
( select
....
(
select
......
..
select only no (((
number
( select
end (12 Replies)
Hi
I have written a shell script which used sed code below
sed -i 's/'"$Pattern"'/ /g' $FileName
I want to count the length of Pattern and replace it with equal number of spaces in the FileName.
I have used $(#pattern) to get the length but could not understand how to replace... (8 Replies)
how can i make find/sed to include directory names with spaces
the command is like this
for i in `find wp-content/themes -type f -print0 | xargs -0 grep -l
-iE 'e'`;do sed -i -e 's/word1/word2/gI' "$i";done
but it skips one directory names with spaces
sed: can't read ./Nova: No such... (5 Replies)
SHELL SCRIPT
Hi
I have a file in the following format
Mayank Sushant
Dheeraj Kunal
ARUN Samir
How can i replace the white space in between and replace them with a comma?? The resultant output should be
Mayank,Sushant
Dheeraj,Kunal
ARUN,Samir
i tried using
sed -e... (8 Replies)
Hi
I tried to extract 19 characters (default) enclosed with in tag from a file using cut command. If the characters comprises of double space, the cut command gives the output with a single spacing.
file 1
<name>Kumar Rajasekaran</name>
cut -c7-26 "file1"
the out put i received is ... (48 Replies)
Hi, I'm very new to shell scripting and have searched google and this forum for quite some time now.
I have the following in my xml file:
<recipients>
<member>value1</member>
</recipients>
I need to find a string <recipients> that follows with a new-line and bunch of spaces and... (5 Replies)
Hi,
i call my shell like:
my_shell "my project name"
my script:
#!/bin/bash -vx
projectname=$1
sed s/'PROJECT_NAME ='/'PROJECT_NAME = '$projectname/ <test_config_doxy >temp
cp temp test_config_doxy
the following error occurres:
sed s/'PROJECT_NAME ... (2 Replies)
I am able to include a pdf file as an attachment in an email using the following:
echo "" > reports
elm -s "RW100 PDF Reports" me@myemail.com < reports
However, if I have a filename that contains some spaces, I'm not so lucky. I've tried:
echo "" > reports
but no luck. I keep getting... (1 Reply)