Links replacement on sql dump


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Links replacement on sql dump
# 8  
Old 10-08-2013
Sorry, I will make my self creative and let me know if it's right Smilie
# 9  
Old 10-08-2013
Good approach. We will check your solutions.
# 10  
Old 10-08-2013
I tried this but it didn't work

sed -r 's#/+55.58.[21][6].[2][14][17]]/+#/domain.com/#g' file

Last edited by molwiko; 10-08-2013 at 10:13 AM..
# 11  
Old 10-08-2013
Please use code tags as required by forum rules!

Not too bad. Remove the double closing square bracket at the end, and it will fly. The [6] and [2] aren't necessary, make them 6 and 2.
That regex will also match e.g. 55.58.16.211 or ...217; so if chances are there other, unwanted matches possible und you want exactly and only the two mentioned, other measures need to be taken.
Please be aware that the . in the regex will match any char including dot. If it HAS to be ".", make it \. in the regex.
This User Gave Thanks to RudiC For This Post:
# 12  
Old 10-08-2013
Code:
sed -r 's#/+55.58.[21]6.2[14][17]/+#/domain.com/#g' file

there is any way to know if the cmd did the right Job, the dump is 15MB
# 13  
Old 10-08-2013
Either use a representative subset of the file, or open the resulting file and do a spot check on those addresses.
Of course, you could grep for the original IP; if they have disappeared, things should be well.
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sql dump file - how to get certain values using sed

Hi, I have a dumpfile.sql - ========Start of file================= CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */; CREATE TABLE `test_table1` ( `id` int ) AUTO_INCREMENT=12 CREATE TABLE `test_table2` ( `id` int ) AUTO_INCREMENT=120... (5 Replies)
Discussion started by: ashokvpp
5 Replies

2. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

3. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

4. Shell Programming and Scripting

"links -dump" output format issue

Hi All, I tried searching a lot about this but to no avail. I have a HTML file. I used links -dump file_page.html > text_html.txt What the above command gave me was a filtered text from the HTML file with tags removed. Now, the the output from the above command looked something like this:... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

5. Shell Programming and Scripting

how to break mysql dump sql file

Hi folks I have mysql dump which having insert queries, i want to break that file when 10 complete "INSERTS" lines so extract that line and store in 1.sql and 2.sql and for next 10 insert lines. pls guide me how can i do that. Regards, Bash (2 Replies)
Discussion started by: learnbash
2 Replies

6. Shell Programming and Scripting

use SQL loader to dump a fixed length file in to DB

consider a fixed length file 12345abcd8901 12345abcd7777 12345njdu8888 12345hdku8388 i would like to dump it in to oracle DB using sql loader 12345 in to first coloumn abcd in to second coloumn 8901 in to 3rd coloumn (2 Replies)
Discussion started by: anumkoshy
2 Replies

7. UNIX for Dummies Questions & Answers

help, what is the difference between core dump and panic dump?

help, what is the difference between core dump and panic dump? (1 Reply)
Discussion started by: aileen
1 Replies
Login or Register to Ask a Question