Sponsored Content
Top Forums Shell Programming and Scripting Find text containing paths and replace with a string in all the python files Post 302454911 by noorsam on Monday 20th of September 2010 08:23:45 AM
Old 09-20-2010
It worked correctly for me now...

Thanks for your quick responses.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find and replace a string in multiple files

I used the following script cd pathname for y in `ls *`; do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y; done and it worked fine for finding and replacing strings with names etc. in all files of the given path. I'm trying to replace a string which consists of path (location of file) ... (2 Replies)
Discussion started by: pharos467
2 Replies

2. Shell Programming and Scripting

find and replace string in a directory files

Hi, I have a directory has DIR1 and the D1 directory has 200+ files. I want change the string from "Bangalore" to "Bangaluru" in all files in the D1 directory. Thanks (2 Replies)
Discussion started by: koti_rama
2 Replies

3. Shell Programming and Scripting

To find and replace paths consisting \

Hi all, I am new to unix and wanted to replace the string consisting \ with nothing. I tried the following but did not help. for y in `ls DIV*`; do sed s/C:\\Project\\AML\\bin//g $y > temp mv temp $y done I actually want to remove any occurance of C:\Project\ABC\bin in... (4 Replies)
Discussion started by: cv_pan
4 Replies

4. Shell Programming and Scripting

find and replace a search string recursively in files

Hi , I have a directory structure as dir and subdirectories and files under it and so on.now I need to find the files which contain the search string under every dir and subdir and replace . my search string is like searchstring=/a/b string to be replaced=/a/c/b please help. ... (7 Replies)
Discussion started by: mohanpadamata
7 Replies

5. Shell Programming and Scripting

Find and add/replace text in text files

Hi. I would like to have experts help on below action. I have text files in which page nubmers exists in form like PAGE : 1 PAGE : 2 PAGE : 3 and so on there is other text too. I would like to know is it possible to check the last occurance of Page... (6 Replies)
Discussion started by: lodhi1978
6 Replies

6. Shell Programming and Scripting

Find and replace using 2 text files as arrays.

Here's the nonfunctional code I have so far #!/bin/bash searchFor=(`cat filea.txt` ) replaceWith=(`cat fileb.txt`) myMax=${#searchFor} myCounter=1 while ; do sed -i 's/${$searchFor}/${$replaceWith}/g' done The goal is to use each line in filea.txt as a search term, and each line... (2 Replies)
Discussion started by: Erulisseuiin
2 Replies

7. Shell Programming and Scripting

Replace directory paths in multiple files at once

I need to update about 2400 files in a directory subtree, with a new directory path inside the files I need to change this occurence in all files: /d2/R12AB/VIS/apps/tech_st/10.1.2 with this: /u01/PROD/apps/apps_st/10.1.3 I know how to change single words using "find . -type f -print0 |... (6 Replies)
Discussion started by: wicus
6 Replies

8. Programming

Python: Check 2 text files for string and print contexts

I have 2 text files: cities.txt San Francisco Los Angeles Seattle Dallas master.txt Atlanta is chill and laid-back. I love Los Angeles. Coming to Dallas was the right choice. New York is so busy! San Francisco is fun. Moving to Boston soon! Go to Seattle in the summer. ... (0 Replies)
Discussion started by: pxalpine
0 Replies

9. UNIX for Beginners Questions & Answers

Find and replace a string in a text file

Dear all, I want to find all the "," in my text file and then replace the commas to a tab. I found a script online but I don't know how to modify the script for my case. Any one can help? Thank you. @echo off &setlocal set "search=%1" set "replace=%2" set "textfile=Input.txt" set... (2 Replies)
Discussion started by: forevertl
2 Replies

10. UNIX for Beginners Questions & Answers

Find all .sh files in file system and need to replace the string inside .sh files

Hi All, I need to write a script to find all "*.sh" files in /home file system and if any string find "*.sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this. find / -name... (3 Replies)
Discussion started by: bhas85
3 Replies
HTTP::Recorder(3pm)					User Contributed Perl Documentation				       HTTP::Recorder(3pm)

NAME
HTTP::Recorder - record interaction with websites SYNOPSIS
Using HTTP::Recorder as a Web Proxy Set HTTP::Recorder as the user agent for a proxy, and it rewrites HTTP responses so that additional requests can be recorded. The Proxy Script For quick start, run the httprecorder script httprecorder This will open a local proxy on port 8080, and will dump the recorded traffic to a file named http_traffic in the current directory. use the -help parameter for usage info Start the proxy script, then change the settings in your web browser so that it will use this proxy for web requests. For more information about proxy settings and the default port, see HTTP::Proxy. The script will be recorded in the specified file, and can be viewed and modified via the control panel. For better control, use this example: #!/usr/bin/perl use HTTP::Proxy; use HTTP::Recorder; my $proxy = HTTP::Proxy->new(); # create a new HTTP::Recorder object my $agent = new HTTP::Recorder; # set the log file (optional) $agent->file("/tmp/myfile"); # set HTTP::Recorder as the agent for the proxy $proxy->agent( $agent ); # start the proxy $proxy->start(); Start Recording Now you can use your browser as your normally would, and your actions will be recorded in the file you specified. Alternatively, you can start recording from the Control Panel. Using the Control Panel If you have Javascript enabled in your browser, go to the HTTP::Recorder control URL (http://http-recorder by default), optionally type a URL into the "Goto page" field, and click "Go". In the new window, interact with web sites as you normally do, including typing a new address into the address field. The Control Panel will be updated after each recorded action. The Control Panel allows you to modify, delete, or save your script. SSL sessions As of version 0.03, HTTP::Recorder can record SSL sessions. To begin recording an SSL session, go to the control URL (http://http-recorder/ by default), and enter the initial URL. Then, interact with the web site as usual. Script output By default, HTTP::Recorder outputs WWW::Mechanize scripts. However, you can override HTTP::Recorder::Logger to output other types of scripts. Functions new Creates and returns a new HTTP::Recorder object, referred to as the 'agent'. $agent->prefix([$value]) Get or set the prefix string that HTTP::Recorder uses for rewriting responses. $agent->control([$value]) Get or set the URL of the control panel. By default, the control URL is 'http-recorder'. The control URL will display a control panel which will allow you to view and edit the current script. $agent->logger([$value]) Get or set the logger object. The default logger is a HTTP::Recorder::Logger, which generates WWW::Mechanize scripts. $agent->ignore_favicon([0|1]) Get or set ignore_favicon flag that causes HTTP::Recorder to skip logging requests favicon.ico files. The value is 1 by default. $agent->file([$value]) Get or set the filename for generated scripts. The default is '/tmp/scriptfile'. Bugs, Missing Features, and other Oddities Javascript WWW::Mechanize can't play back Javascript actions, and HTTP::Recorder doesn't record them. Why are my images corrupted? HTTP::Recorder only tries to rewrite responses that are of type text/*, which it determines by reading the Content-Type header of the HTTP::Response object. However, if the received image gives the wrong Content-Type header, it may be corrupted by the recorder. While this may not be pleasant to look at, it shouldn't have an effect on your recording session. See Also See also LWP::UserAgent, WWW::Mechanize, HTTP::Proxy. Requests &; Bugs Please submit any feature requests, suggestions, bugs, or patches at http://rt.cpan.org/, or email to bug-HTTP-Recorder@rt.cpan.org. If you're submitting a bug of the type "X doesn't record correctly," be sure to include a (preferably short and simple) HTML page that demonstrates the problem, and a clear explanation of a) what it does that it shouldn't, and b) what it should do instead. Author Copyright 2003-2005 by Linda Julien <leira@cpan.org> Maintained by Shmuel Fomberg <semuelf@cpan.org> Released under the GNU Public License. perl v5.14.2 2012-04-23 HTTP::Recorder(3pm)
All times are GMT -4. The time now is 03:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy