Sponsored Content
Top Forums Shell Programming and Scripting fast search and replace in all files Post 302161707 by KevinADC on Friday 25th of January 2008 02:22:16 PM
Old 01-25-2008
Really, the requirements are ridiculous. There is no way to search and replace anything in thousands of files quickly. You might find some ways to faster than others, but nothing is going to be a magic bullet. I suggest you try perls inplace editor, it might be faster than sed although I don't really know.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Fast way of find and replace, help

Hi All, I have nearly 200 files in a directory, each file is of nearly of 5000 lines. Each line of each file is having its 3rd field to be replaced by corresponding replace_string(2nd field of file1.out below). i.e. -Search the 3rd field of each line of each of 200 files in file1.out, get... (1 Reply)
Discussion started by: jkl_jkl
1 Replies

2. Shell Programming and Scripting

Search and Replace between two files

Hi all- I've got 2 files: One is the final results and one is a result set from a query. In the final results files I have placeholder strings in there that need to be replaced by the corresponding strings from the query file. So File#1 (FINAL RESULTS) LINEID CLIENT ID REP ... (1 Reply)
Discussion started by: Cailet
1 Replies

3. Shell Programming and Scripting

search and replace in many files

I have a directory full of files. Most of the code in the files is the same accept for a few parameter values. I want to remove hard coded values and replace it with a parameter that I can pass. This is oracle pl/sql anonymous blocks. so the code is similiar to this function myfunc (p_myvar ... (1 Reply)
Discussion started by: guessingo
1 Replies

4. Shell Programming and Scripting

Search and replace text in many files

Hello, I am very new to Linux and am trying to find a way for following problem. I have a number of files in a folder as Export000.dat, Export001.dat ..and so on. Each file has a string field 'Absolute velocity'. I want it to be replaced by 'Pixel shift' in all the files. I tried something like... (4 Replies)
Discussion started by: chirag.joshi
4 Replies

5. Shell Programming and Scripting

Search and replace string in files

I'm trying to remove the following string from several files. <img heigth="1" width="1" border="0" src="http://myteenmovies.net/t.php?id=5540372">I'm using the following script #!/bin/bash # This script will search and replace all regular files for a string # supplied by the user and... (1 Reply)
Discussion started by: d13g0sv
1 Replies

6. UNIX for Dummies Questions & Answers

Search and replace across files

Hi All, HP-UX oradev3 B.11.11 U 9000/800 3251073457 I have following files all contains text like "919642990137@". I need to search this text across all files and replace it with something like "919717298765@". I was wondering, how to accomplish this task? cpmprod_status.sh... (8 Replies)
Discussion started by: alok.behria
8 Replies

7. Programming

Search and replace in two different files

Hi there, i got the following problem. i need a bash script to correct e-mail addresses in an csv. i got a huge csv like this A B C D heiner.holber.somewhere.ch heiner holber heiner.holber@somewhere.ch So A is the wrong... (8 Replies)
Discussion started by: molker
8 Replies

8. Shell Programming and Scripting

Search and Replace in multiple files

Hello, I have hundreds of files in which I need to change email address. Here is what I am trying to do: 1. All text files are in a directory "a" 2. In the text file, I want to replace email address for preparer. All these lines start with {{PreparerEmail and end with }}. The email... (3 Replies)
Discussion started by: cartrider
3 Replies

9. Shell Programming and Scripting

Search replace with awk using 2 files

I have a bit of a complex problem that I would like to solve with awk. It is essentially a 2-part problem. I have a large directory of files with the same format, each with 266 lines. The first 206 lines of each file are filled with attribute information. Then the following 60 lines consist... (4 Replies)
Discussion started by: owwow14
4 Replies

10. UNIX for Dummies Questions & Answers

Search in one type of files and replace

I am not sure how to search and replace the word in the few specific files. I need to search and replace word in only the name containing pepsi in the filename. (12 Replies)
Discussion started by: ramkumar15
12 Replies
DIST(1) 							     [nmh-1.5]								   DIST(1)

NAME
dist - redistribute a message to additional addresses SYNOPSIS
dist [+folder] [msg] [-form formfile] [-annotate | -noannotate] [-inplace | -noinplace] [-draftfolder +folder] [-draftmessage msg] [-nodraftfolder] [-editor editor] [-noedit] [-width columns] [-from address] [-to address] [-cc address] [-fcc +folder] [-whatnowproc program] [-nowhatnowproc] [-atfile] [-noatfile] [-version] [-help] DESCRIPTION
Dist is similar to forw. It prepares the specified message for redistribution to addresses that (presumably) are not on the original address list. The default message form contains the following elements: Resent-From: {from switch} or <Local-Mailbox> or <username@hostname> Resent-To: {to switch} or blank Resent-cc: {cc switch} or blank Resent-fcc: {fcc switch} or blank If a file named "distcomps" exists in the user's nmh directory, it will be used instead of this default form. You may specify an alternate forms file with the switch -form formfile. Forms are processed via the nmh template system; see mh-format(5) for details. Components from the redistributed message are available as standard component escapes in the forms file. In addition to the standard mh-format(5) escapes, the following component escapes are also supported: Escape Returns Description fcc string Any folders specified with `-fcc folder' nmh-from string Addresses specified with `-from address' nmh-to string Addresses specified with `-to address' nmh-cc string Addresses specified with `-cc address' See the forw(1) man page for descriptions of the -from, -to, -cc, and -fcc switches. If the draft already exists, dist will ask you as to the disposition of the draft. A reply of quit will abort dist, leaving the draft intact; replace will replace the existing draft with a blank skeleton; and list will display the draft. Only those addresses in "Resent-To:", "Resent-cc:", and "Resent-Bcc:" will be sent. Also, a "Resent-Fcc: folder" will be honored (see send(1)). Note that with dist, the draft should contain only "Resent-xxx:" fields and no body. The headers and the body of the original message are copied to the draft when the message is sent. Use care in constructing the headers for the redistribution. If the -annotate switch is given, the message being distributed will be annotated with the lines: Resent: date Resent: addrs where each address list contains as many lines as required. This annotation will be done only if the message is sent directly from dist. If the message is not sent immediately from dist, "comp -use" may be used to re-edit and send the constructed message, but the annotations won't take place. Normally annotations are done inplace in order to preserve any links to the message. You may use the -noinplace switch to change this. See comp(1) for a description of the -editor and -noedit switches. Note that while in the editor, the message being resent is available through a link named "@" (assuming the default whatnowproc). In addition, the actual pathname of the message is stored in the environment variable $editalt, and the pathname of the folder containing the message is stored in the environment variable $mhfolder. The creation of the "@" file and associated environment variables can be controlled via the -atfile and -noatfile options. The -draftfolder +folder and -draftmessage msg switches invoke the nmh draft folder facility. This is an advanced (and highly useful) fea- ture. Consult the mh-draft(5) man page for more information. Upon exiting from the editor, dist will invoke the whatnow program. See whatnow(1) for a discussion of available options. The invocation of this program can be inhibited by using the -nowhatnowproc switch. (In truth of fact, it is the whatnow program which starts the initial edit. Hence, -nowhatnowproc will prevent any edit from occurring.) FILES
/etc/nmh/distcomps The standard message skeleton or <mh-dir>/distcomps Rather than the standard skeleton $HOME/.mh_profile The user profile <mh-dir>/draft The draft file PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder Draft-Folder: To find the default draft-folder Editor: To override the default editor fileproc: Program to refile the message whatnowproc: Program to ask the "What now?" questions SEE ALSO
comp(1), forw(1), repl(1), send(1), whatnow(1) DEFAULTS
`+folder' defaults to the current folder `msg' defaults to cur `-noannotate' `-nodraftfolder' `-inplace' `-atfile' CONTEXT
If a folder is given, it will become the current folder. The message distributed will become the current message. HISTORY
Dist originally used headers of the form "Distribute-xxx:" instead of "Resent-xxx:". In order to conform with the ARPA Internet standard, RFC-822, the "Resent-xxx:" form is now used. Dist will recognize "Distribute-xxx:" type headers and automatically convert them to "Resent-xxx:". BUGS
Dist does not rigorously check the message being distributed for adherence to the transport standard, but post called by send does. The post program will balk (and rightly so) at poorly formatted messages, and dist won't correct things for you. If whatnowproc is whatnow, then comp uses a built-in whatnow, it does not actually run the whatnow program. Hence, if you define your own whatnowproc, don't call it whatnow since comp won't run it. If your current working directory is not writable, the link named "@" is not available. MH.6.8 11 June 2012 DIST(1)
All times are GMT -4. The time now is 04:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy