Sponsored Content
Top Forums Shell Programming and Scripting Multiple Line awk search and replace Post 302850659 by bobbygb2003 on Thursday 5th of September 2013 09:55:51 AM
Old 09-05-2013
I figured out the last piece, i needed to use \\\&\\\&. Everything is working now!!!


THANKS A BUNCH FOR THE HELP!!! My awk statement was missing the s=$0 and I was trying to use sed instead of sub.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

2. Shell Programming and Scripting

Does Sed Search/Replace Work For Multiple Matches On The Same Line?

Hello, I would like to delete all the footnotes in all my htm files. Hence, I have to delete the whole font tag pairs, i.e. deleting everything between the begin/end font tags. I create a testfile, of which data parts of all four lines are the same except for the number of font tag pairs,... (3 Replies)
Discussion started by: cibalo
3 Replies

3. Shell Programming and Scripting

perl search and replace - search in first line and replance in 2nd line

Dear All, i want to search particular string and want to replance next line value. following is the test file. search string is tmp,??? ,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50 tmp,123 --- if match tmp,??? then... (3 Replies)
Discussion started by: arvindng
3 Replies

4. Shell Programming and Scripting

awk multiple-line search and replace one-liner

Hi I am trying to search and replace a multi line pattern in a php file using awk. The pattern starts with <div id="navbar"> and ends with </div> and spans over an unknown number of lines. I need the command to be a one liner. I use the "record separator" like this : awk -v... (8 Replies)
Discussion started by: louisJ
8 Replies

5. Shell Programming and Scripting

awk + gsub to search multiple input values & replace with located string + extra text

Hi all. I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value. cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Discussion started by: dazhoop
2 Replies

6. Shell Programming and Scripting

awk delete/remove rest of line on multiple search pattern

Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum: infile: 64_1535: Delm. = 86 var, aaga 64_1535: Fran. = 57 ex. ccc 64_1639: Feb. = 26 (link). def 64_1817: mar. = 3/4. drz ... (7 Replies)
Discussion started by: sdf
7 Replies

7. Shell Programming and Scripting

Search & Replace: Multiple Strings / Multiple Files

I have a list of files all over a file system e.g. /home/1/foo/bar.x /www/sites/moose/foo.txtI'm looking for strings in these files and want to replace each occurrence with a replacement string, e.g. if I find: '#@!^\&@ in any of the files I want to replace it with: 655#@11, etc. There... (2 Replies)
Discussion started by: spacegoose
2 Replies

8. Shell Programming and Scripting

awk to search for specific line and replace nth column

I need to be able to search for a string in the first column and if that string exists than replace the nth column with "-9.99". AW12000012012 2.38 1.51 3.01 1.66 0.90 0.91 1.22 0.82 0.57 1.67 2.31 3.63 0.00 AW12000012013 1.52 0.90 1.20 1.34 1.21 0.67 ... (14 Replies)
Discussion started by: ncwxpanther
14 Replies

9. Shell Programming and Scripting

Multiple line search, replace second line, using awk or sed

All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed... I have an input file similar to: &LOG &LOG Part: "@DB/TC10000021855/--F" &LOG &LOG &LOG Part: "@DB/TC10000021852/--F" &LOG Cloning_Action: RETAIN &LOG Part: "@DB/TCCP000010713/--A" &LOG &LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies

10. UNIX for Dummies Questions & Answers

Using awk to multiple and replace in a specific line

Hi Folks, I have the file in which I need to multiply the content of a line and replace the initial content of that line with the obtained answer. For example if this is my input file file1.txt 2.259314750 xxxxxx 1.962774350 xxxxxx 2.916817290 xxxxxx 1.355026900 ... (4 Replies)
Discussion started by: Madiouma Ndiaye
4 Replies
ppdof(8)						      System Manager's Manual							  ppdof(8)

NAME
ppdof - Text to PostScript translation filter SYNOPSIS
/usr/lbin/ppdof +Cfilename [-n login] [-h host] [...] OPTIONS
Use of the print flags is dependent on the features available on the print device, and on the current status of those features. For exam- ple, when you select a particular paper size, the appropriate paper must be correctly loaded in the paper trays. Options in /etc/printcap The following options are set in the /etc/printcap file and can be specified using the + switch. For example: :if=/usr/lbin/ppdof +Bupper +Cln32.rpd: You can also specify command line options in the /etc/printcap file using the + switch. For example: :if=/usr/lbin/ppdof +Olandscape +Cln32.rpd: Here, the -Olandscape option is specified. Specifies the default tray name to select for printing the banner page. For example: :of=/usr/lbin/ppdof +Bupper +Cln32.rpd: In this example, the banner page will be printed on whatever stock is currently loaded into the upper tray on the selected print device. Specifies the printer configuration file to use for the print job. Specifies the unit of measurement to be inches or cen- timeters for lines per inch (lpi), characters per inch (cpi), and page margin options. The default value is inches. Specifies the default tray name to select for printing the trailer page. For example: :if=/usr/lbin/ppdof +olower +Cln32.rpd: Command Line Options Specify print filter options at the command line using the lpr command as follows. Multiple -O options are supported. Specifies the host name from which the job owner is submitting the print command. Specifies the login (account) name of the job owner. Specifies the name of the output tray where the printed pages are placed. Specifies the page width in columns for portrait and landscape printing. A page width of 0 instructs the filter to use 80 columns in portrait orientation and 132 columns in landscape orientation. Specifies the tray name from which print paper is selected. The printer may select an alternate tray when the paper size provided in the tray does not match the docu- ment requirements. Specifies the number of sides to print on each sheet. You can specify sides as follows: 1 or one - Print on one side of the sheet. 2 or two - Print on both sides of the sheet (duplex printing). Specifies options related to page orientation, formatting, and features as follows: Specifies the number of characters to print per inch. Specifies only even numbered sheets are to be printed. Speci- fies the printed output is parallel to the long side of the page. Specifies the number of lines to print per page. Specifies the number of lines to print per inch. Specifies only odd numbered sheets are to be printed. Specifies the range of pages to be printed, starting with page number m and ending with page number n. Specifies to print the list of options provided by the printer configuration file which includes paper sizes, input and output paper tray names. For example: # lpr -Oprint /etc/motd (Note that the file /etc/motd is specified to satisfy lpr command line requirements, the file itself is not printed.) Specifies the printed output is parallel to the short side of the page. These options specify the various page margins in inches. The page mar- gin sizes in inches as follows: tm= - Top margin in inches. For example -Otm=2 bm= - Bottom margin in inches. For example -Obm=1.5 lm= - Left margin in inches. For example -Olm=1 rm= - Right margin in inches. For example -Orm=3 pm= - Page margin. Using this option sets tm, bm, lm and rm to the same value. For example -Opm=1.25 When configuring the /etc/printcap entry, different margins for landscape and portrait orientation can be specified by adding the suffixes _l and _p respectively. For example: :if=/usr/lbin/ppdof +Olm_p=0.5 +Olm_l=0.25 +Cln32.rpd: DESCRIPTION
The ppdof filter translates ASCII to PostScript and handles the device dependencies of a PostScript printer. It is recommended that the ppdof filter be specified for both the :of and the :if fields in the /etc/printcap file. For a description of these fields, see the printcap(4) reference page. RESTRICTIONS
The commands generated by the ppdof filter to handle device dependencies might be incompatible with some PostScript documents. When a PostScript file does not print correctly use the following command to prevent file preprocessing. # lpr -x file.ps The filter will not setup device dependencies or provide ASCII to PostScript translation for documents containing printer control charac- ters. EXIT STATUS
Any value other than zero (0) indicates that an error has occurred. ERRORS
Use the lf error log field in the /etc/printcap to specify the name of the error log file. SEE ALSO
Commands: cancel(1), lpr(1), pr(1) Files: printcap(4). System Administration ppdof(8)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy