Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to Find /replace and print? Post 77407 by vino on Friday 8th of July 2005 12:10:31 AM
Old 07-08-2005
I can help with you the sed part. I am retaining your lp part of the code.

Code:
sed -e 's/Times-Roman/Helvetica/g' -e 's/Times/Helvetica/g' oldfile > newfile < lp

You can avoid two sed altogether.

Vino
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find and replace

Hi, Iam new to shell script.How to write bourn shell script for find and replace. My requirement is: variable: name="abcd & co" i wanted to replace '&' with amp; plz suggest with out using sed. Thanks lot. (2 Replies)
Discussion started by: ram2s2001
2 Replies

2. UNIX for Advanced & Expert Users

Please help with find and replace:

Hi I am trying to find a product code hightlighted in red, and re-insert it at another place on the same file. I shall be grateful if anyone can help me with this. Stuck and have deadline!!:confused: Original Line: (I can get source data in one of these two formats) ISD=977155185403901+DIE... (2 Replies)
Discussion started by: gloovy_tb
2 Replies

3. Shell Programming and Scripting

Find x and print its record

Hi all, I have a file containing two fields with 154 rows/records/lines (forgive me, my UNIX terminology is not quite up to par yet). I am trying to read from this list, find a value (lets say 0), then print the record/line/row that value falls on (In this case it would be record/line/row #27)?... (5 Replies)
Discussion started by: StudentServitor
5 Replies

4. Shell Programming and Scripting

find and replace

Hi I am very new to shell scripting (and linux in general)... I am trying to build some script, that will read a person from a csv file, (each person will have an ID, eg id001abc, which will go up one by one a few hundred times) then when find and replace the matching data in an xml file. ... (4 Replies)
Discussion started by: sam.breslin
4 Replies

5. Shell Programming and Scripting

how to find out recurrence and print it.

Hi all, I have a file having data like this: rs4332761 15XB rs4332761 unk rs4571228 15XB rs457263 5XB rs4606515 10XA rs4606515 10XB rs4606515 15XB I want output like this: rs4332761 15XB,unk rs4571228 15XB rs457263 5XB rs4606515 10XA,10XB,15XB I... (2 Replies)
Discussion started by: pirates.genome
2 Replies

6. Shell Programming and Scripting

Find and print Modification

Hi All I am stuck with a problem and i want your help. I have a file in which content of that file looks like-: <tr> <td><A HREF="http://333.33.333.33:3333/">Pan Eligibility</A></td> <td>NNNNNNNN_NS</td> <td>333.33.333.33</td> <td>3333</td> <td><p... (7 Replies)
Discussion started by: parthmittal2007
7 Replies

7. Shell Programming and Scripting

Hold, Replace and Print with sed

Hi, I'm a newbie with scripting so I'd appreciate any help. I have a file import.txt with below text AA_IDNo=IDNoHere AA_Name=NameHere AA_Address=AddressHere AA_Telephone=TelephoneHere AA_Sex=SexHere AA_Birthday=BirthdayHere What I need is that the Lines for Name, Address and... (3 Replies)
Discussion started by: heretolearn
3 Replies

8. Shell Programming and Scripting

Scripting a global find and replace in an VME output print file

Hi Folks, Below is an extract from a VME Print file which gets handed over to a print house. The problem I have is not that tricky rther looking for a way to handle it in a simple and clean way. Is to first select all lines with "0058" which have four spaces so "0058 " as the selcetion... (3 Replies)
Discussion started by: Gary Hay
3 Replies

9. Shell Programming and Scripting

Need help for sed replace and print

Hi I am working with sed to get string replace and print all the lines. Cat f1 <text1> tag123 44412c232place1 text456-text= tag12 44412c232place4 jjaa TAG456 44412c232place1066dfdf erer .. i have used this command - sed -n '/tag/ s#place#SomePlace#gp' f1 It gives me... (2 Replies)
Discussion started by: krsnadasa
2 Replies

10. UNIX for Beginners Questions & Answers

Awk, find and print

Ubuntu, Bash 4.3.48 Hi, I have this input file with many columns separated with ":" ARC=121:ERF=12244:IDE=2334:ADA=34 .... ERF=124:ARC=123:IDE=2344:ADA=54 .... ERF=16254:IDE=2434:ADA=78:ARC=134 .... and I want this: ARC=121:IDE=2334 ARC=123:IDE=2344 ARC=134:IDE=2434 I need to... (5 Replies)
Discussion started by: echo manolis
5 Replies
OGONKIFY(1)						      General Commands Manual						       OGONKIFY(1)

NAME
ogonkify - international support for PostScript SYNOPSIS
ogonkify [-p procset] [-e encoding] [-r Old=New] [-a] [-c] [-h] [-t] [-A] [-C] [-H] [-T] [-AT] [-CT] [-ATH] [-CTH] [-E] [-N] [-M] [-mp] [-SO] [-AX] [-F] [-RS] [--] file ... DESCRIPTION
ogonkify does various munging of PostScript files related to printing in different languages. Its main use is to filter the output of Net- scape, Mosaic and other programs in order to print in languages that don't use the standard Western-European encoding (ISO 8859-1). SUMMARY USAGE
Installation instructions are provided in the file INSTALL. Assuming the installation has been correctly completed, save the PostScript output of Netscape or Mosaic to a file, say output.ps. Then print it using % ogonkify -AT -N output.ps | lpr in the case of Netscape, or % ogonkify -AT -M output.ps | lpr in the case of Mosaic. You may want to change the -AT option to -CT in order to use a high quality Courier font from IBM (at the price of slower printing). An alternative way to print from Netscape is to set the printing command in the printing dialog box to: ogonkify -AT -N | lpr For more details, see the USAGE section below. OPTIONS
-p Includes the specified procset in the output file. -e Set the encoding of the output. Defaults to L2 (ISO 8859-2, a.k.a. ISO Latin-2). Other possible values are L1 (ISO 8859-1, a.k.a. ISO Latin-1), L3 (ISO 8859-3, a.k.a. ISO Latin-3), L4 (ISO 8859-4, a.k.a. ISO Latin-4), L5 (ISO 8859-9, a.k.a. ISO Latin-5), L6 (ISO 8859-10, a.k.a. ISO Latin-6), L7 (ISO 8859-13, a.k.a. ISO Latin-7), L9 (ISO 8859-15, a.k.a. ISO Latin-9), CP1250 (Microsoft Code Page 1250, a.k.a. CeP), ibmpc (Original IBM-PC encoding), mac (Apple Macintosh encoding) and hp (HP Roman Encoding). -r Use the font New in place of Old. Will lead to ugly or unreadable output when the metrics mismatch. -a Do the right font remappings for using Courier-Ogonki in place of Courier (the a stands for Adobe Courier). This avoids downloading any fonts to the printer. -c Do the right font remappings for using IBM Courier in place of Adobe Courier. -t Do the right font remappings for using Times-Roman-Ogonki in place of Times-Roman. -h Do the right font remappings for using Helvetica-Ogonki in place of Helvetica. -A Like -a but also downloads the Courier-Ogonki fonts. -C Like -c, but also downloads the IBM Courier fonts. -H Like -h, but also downloads the Helvetica-xxx-Ogonki fonts. -T Like -t, but also downloads the Times-xxx-Ogonki fonts. -CT Equivalent to -C -T. -CTH Equivalent to -C -T -H. -E Add the Euro currency sign to all standard fonts (use with -e L9). -N Do Netscape processing. -M Do Mosaic processing. -mp Do mp processing. Will not work with the -A option (use -C instead). -SO Do StarOffice processing. -AX Do ApplixWare processing. -F Do XFig processing. -RS Recode standard fonts. This is likely to work with applications that leave fonts in AdobeStandardEncoding, typically applications that do not even support printing even of characters. -- End options. USAGE
Let us assume that you want to print a WWW page encoded in ISO Latin-2. Netscape stubbornly insists on printing it as ISO Latin-1. By using the File->Print command, have Netscape send the output to a file, say alamakota.ps. As ogonkify is configured for ISO Latin-2 by default, passing it the PostScript generated by Netscape will correct the encoding of the fonts. It is enough to do: % ogonkify -N <alamakota.ps | lpr However, most printers do not have fonts with the needed characters installed; synthetized fonts will be downloaded and used instead of Courier and Times-Roman with -AT, and a very good Courier font from IBM will be used with: -CT. The command will therefore typically be: % ogonkify -N -AT <alamakota.ps | lpr or eventually % ogonkify -N -CT <alamakota.ps | lpr Typical usage with other programs is: % ogonkify -M -AT <alamakota.ps | lpr % ogonkify -mp -AT <alamakota.ps | lpr % ogonkify -SO -AT <alamakota.ps | lpr % ogonkify -AX -ATH <alamakota.ps | lpr % ogonkify -XF -ATH <alamakota.ps | lpr BUGS
Characters with an `ogonek' should be constructed differently (for instance, the `ogonek' used with an `a' should be differently shaped than the one used with an `e'.) It would be better to patch the programs we have the sources to than to post-process the produced PostScript. The program is written in Perl. NOTES
In order to view the output PostScript with Ghostscript, you might need to run gs with the flag -dNOPLATFONTS, and ghostview with the flag -arguments -dNOPLATFONTS. Netscape, IBM, Adobe, PostScript, StarOffice, ApplixWare and possibly others are registered trademarks. THANKS
Much of the composite character data have been provided by Primoz Peterlin, H. Turgut Uyar, Ricardas Cepas, Kristof Petrovay and Jan Prikryl. Jacek Pliszka provided the support for StarOffice. Andrzej Baginski provided the support for ApplixWare. Markku Rossi wrote genscript and provided many useful encoding vectors with the distribution. Throughout writing the Postscript code, I used the ghostscript interpreter, by Peter Deutsch. Larry Wall wrote perl, the syntax and semantics of which are a never ending source of puzzlement. AUTHOR
Juliusz Chroboczek <jec@dcs.ed.ac.uk>, with help from loads of people. McKornik Jr. 14 May 1999 OGONKIFY(1)
All times are GMT -4. The time now is 01:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy