Extended replacing of nonspecific strings in text files [beware complicated !]
Well, to make another post at this helpful forum :
I recently tried something like this, I want to replace all those numberings/letters that are located
between <string>file://localhost/var/mobile/Applications/ and /Documents/</string>
Seems, like a good approach, however not exactly what I was looking for.
To clarify more:
- ONLY the numberings BETWEEN<string>file://localhost/var/mobile/Applications/ and the /Documents/</string> should be replaced
in the end it should look like this:
(however, your approach with the 1234-1234-1234-1234-1234 etc. would be fine aswell)
Sorry if I confused you, I didn't meant to...
Also, I'm not sure if my platform supports perl, I surmise not, would this be doable in awk or simple shell aswell ?
Ok, I will try your perl script later on my linux portion of my pc .
Thanks a ton ! (Just out of curiosity, since perl is the only thing you coded and you can't code in awk, is a sed shell operation viable here ? I guess no, but still xD)
Like I said, the script provided won't fix my problem (since its written in perl), however I found another way to get this fixed:
I found out the lines of the plist that need to be changed and then used this:
53 = line number
VARIABLE = Text that will completly replace the line
That works really well, because the line positions won't change in my file and I just replace them as whole .
Still, gotta love this forum, getting an answer to such a complex problem sure rocks ^^.
I am working with a log file that I am trying to clean up by removing non-English ASCII characters. I am using Bash via Cygwin on Windows.
Before I start I set:
export LC_ALL=C
I clean it up by removing all non-English ASCII characters with the following command;
grep -v $''... (4 Replies)
i'm trying to figure out the easiest way to replace a string:
pineapple pineapple-reg
basketball basketball-reg
football foot-reg-ball
i'm storing the above in a file called wordstoreplace.txt
for each line above, the word in the first column is to be replaced by the word in the second... (4 Replies)
Hallo Everyone.
I have to admit I'm shell scripting illiterate . I need to find certain strings in several text files and replace each of the string by unique & corresponding text.
I prepared a csv file with 3 columns: <filename>;<old_pattern>;<new_pattern>
... (5 Replies)
Hi,
We have a file (e.g. a .csv file, but could be any other format), with 2 columns: the old value and the new value. We need to modify all the files within the current directory (including subdirectories), so find and replace the contents found in the first column within the file, with the... (9 Replies)
Hello all,
This is my first post and I hope you can help me out.
I searched for quite some hours now and haven't found a simple solution to my problem.
It is as following:
I got this file:
dl.dropbox.com/u/14586156/stuff/Bookmarks.plist
and want to replace the Text between... (9 Replies)
Can someone help me? I been figuring out how I can search and extract a complicated search string from a file. The whole string is delimited by a period. And the file where I'm searching is composed of differnt string such as that. For example, I have this search string:
and I have a file... (3 Replies)
Hi all
I have two files X.txt and Y.txt. The file format of X.txt is :
madras is also the fountainhead of the theosophical movement which spread worldwide .
and second file Y.txt is of the format:
madra|s|nsubj is|cop also|advmod the|det fountainhead|empty of|prep the|det... (3 Replies)
Hi,
Im trying to update some properties files with text from another file:
file1
user=xyz
file2
user=
after script
file2
user=xyz
Im using this reading the $QUARTZURL,ETC... from quartz.properties:
echo... (1 Reply)
Hi experts,
I have the file with these lines:
var1=thu_13:12:32,var2=Microsoft,var3=240ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53
var1=thu_13:13:32,var2=Microsoft,var3=213ms,var4=Mozilla/4.0_(sun;_MSIR_3-4;_windows.;_NET_1.1323.53... (9 Replies)
Hi,
I have 2 sets of text files. I need to take a field from a certain line in set 1 and put it in the same place in set b. The line appears once per file, in different places but is a set format and has the unique word "ANTENNA" in it and is always 81 characters long. Example from set a:
... (7 Replies)