Sponsored Content
Top Forums Shell Programming and Scripting Replacing all occurences depending on parity Post 302364903 by beni22sof on Saturday 24th of October 2009 01:45:42 PM
Old 10-24-2009
Replacing all occurences depending on parity

I want to replace all occurences of '$' in a LaTeX source code in the following way: The dollars on odd position in the file must be changed in '$latex ' and the other dollars can remain the same.

I was thinking to make a script which replaces all odd occurences of a given character with a string, and all even occurences of the same character with another string.

I would be glad to get some help.
Thanks.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Counting number of occurences

Hi All, I have to count the number of occurences of the character " ; " in a given line. I had used the following awk command to achieve the same echo $KOP.dat|awk '{split($1,my,";"); for(i in my)c++ }END{print c-1}' My file KOP.dat had the following data ... (1 Reply)
Discussion started by: kingofprussia
1 Replies

2. Shell Programming and Scripting

occurences of words

I have a string like this. $str="The astrocyte profile might contribute to the identification of possible therapies in profiles profiling and profiled als."; Lets consider for example: a)If user enters the term profile* it should highlight profile,profiles only. b)If user enters the... (3 Replies)
Discussion started by: vanitham
3 Replies

3. Shell Programming and Scripting

no of occurences of q word

hi I hace a string "abc,def,ghi,abc,def ,ghi,abc,def,ghi,abc,def ,ghi,abc" i replaced commas with spaces, now i want to calculate nof occurences of "abc" word. thanks in advance Satya (6 Replies)
Discussion started by: Satyak
6 Replies

4. Linux

kernel: Additional sense: Scsi parity error ()

Hey guys how do you troubleshoot this kind of problem kernel: Additional sense: Scsi parity error () (2 Replies)
Discussion started by: sbn
2 Replies

5. Shell Programming and Scripting

Perl - Count occurences

I have enclosed the script. I am able to find the files that contain my search string but when I try to count the occurences within the file I get zero always. Any help on this. #!/usr/bin/perl my $find = $ARGV; my $replace = $ARGV; my $glob = $ARGV; @filelist = <*$glob>; # process each... (22 Replies)
Discussion started by: TimHortons
22 Replies

6. UNIX for Dummies Questions & Answers

Parity, SRM, VSA/Fusion, Service Portal, Remotely Anywhere, and Tivoli TEC.

Can some one explain or send me the links about these tools Parity, SRM, VSA/Fusion, Service Portal, Remotely Anywhere, and Tivoli TEC. (2 Replies)
Discussion started by: rags
2 Replies

7. Shell Programming and Scripting

Awk to count occurences

Hi, i am in need of an awk script to accomplish the following: Input table looks like: Student1 arts Student2 science Student3 arts Student4 science Student5 science Student6 science Student7 science Student8 science Student9 science Student10 science Student11 science... (8 Replies)
Discussion started by: saint2006
8 Replies

8. Solaris

solaris raids parity

what actually stored in the parity reserved on each slice in raid 5 configuration. how to restore the data if a disk is failed in raid5 configuration (1 Reply)
Discussion started by: revathireddy
1 Replies

9. Shell Programming and Scripting

Order as per top occurences

Hi I have a file with entries like below top 5 a 5 b 4 c 3 d 2 e 1 top 5 b 5 d 4 c 3 e 2 a 1 top 5 e 5 d 4 c 3 b 2 a 1 (2 Replies)
Discussion started by: Viswanatheee55
2 Replies
SGML2LATEX(1)						      General Commands Manual						     SGML2LATEX(1)

NAME
sgml2latex - create LaTeX, DVI, PostScript or PDF output from a LinuxDoc DTD SGML source file SYNOPSIS
sgml2latex [generic-option...] [--output=tex|dvi|ps|pdf] [--bibtex] [--makeindex] [--pagenumber=n] --quick [--latex=hlatexp|platex] [--dvips=dvips|dvi2ps] file[.sgml] DESCRIPTION
sgml2latex is an old and obsoleted form of the latex converter command of LinuxDoc-Tools. It is recommended to switch the new form linux- doc -B latex now. It converts a LinuxDoc DTD SGML source file to LaTeX output, using the nsgmls(1) or onsgmls(1) parser, and the sgml- sasp(1) translator. Using the LaTeX output, and the latex(1) text formatter, you can then create DVI output, and PostScript output using the dvips(1) converter. Output will appear in file.tex for LaTeX output, file.dvi for DVI output, or file.ps for PostScript output, where file is the name of the SGML source file. Using the LaTeX output, and the pdflatex(1) text formatter, you can then create a nice PDF output, suitable for viewing with PDF viewers as xpdf(1), acroread(1) or ghostview(1). The attribute/value pair "output=latex2e" is set for conditionals. OPTIONS
sgml2latex accepts all the generic options described in linuxdoc(1), and the following specific options: --output=fmt, -o Specify the desired output format. The specifier fmt may be ``tex'', ``dvi'', ``ps'', or ``pdf''. Note: This version does not overwrite/remove the intermediate files: tex file for dvi output, or tex/dvi files for ps output. This is dif- ferent behavior from the original SGML-Tools 1.0.9, so you are warned here. --bibtex, -b Process the generated TeX with bibtex(1). --makeindex, -m Generate a TeX index file suitable for processing with makeindex(1) from and <idx> and <cdx> tags present in the SGML source. --pagenumber, -n Set the starting page number in the output DVI or PS file. --quick, -q Do only one pass of LaTeX formatting. This is often not sufficient to produce final output (because of references, etc.) but is useful for spotting TeX errors and justification problems. --pass, -P The argument of the pass option is inserted just after the LaTeX preamble generated by the document-type tag. Specify the desired output format. The specifier fmt may be ``tex'', ``dvi'', ``ps'', or ``pdf''. --latex=alternate_latex_command, -x This option is currently for Korean and Japanese. The alternate_latex_command can be ``latex'' (default), ``hlatexp'' (for Korean), ``platex'' or ``jlatex'' (for Japanese). This option can be used to render Korean document using HLaTeXp, or to render Japanese document using pLaTeX/jLaTeX. If not, HLaTeX should be installed to render Korean document. On the other hand, Japanese document can be rendered with jLaTeX (which is the default when ``-c nippon'' is specified), so if you already have jLaTeX, you may not need to install the pLaTeX. --dvips=alternate_dvips_command, -s This option is currently for Japanese. The alternate_dvips_command can be ``dvips'' or ``dvi2ps''. If you don't know this, then you may not need this. file The SGML source file, named either file or file.sgml FILES
Many files and executables in /usr/share/linuxdoc-tools and /usr/bin are used. BUGS
None known. AUTHOR
Originally written by Greg Hankins <greg.hankins@cc.gatech.edu>, based on scripts by Tom Gordon and Alexander Horz. Later rewritten by Cees de Groot <cg@cdegroot.com>. PDF patches by Juan Jose Amor <jjamor@hispalinux.es>. Currently maintained by Taketoshi Sano <sano@debian.org> for Linuxdoc-Tools. SEE ALSO
linuxdoc(1), sgml2html(1), sgml2info(1), sgml2lyx(1), sgml2rtf(1), sgml2txt(1), sgmlcheck(1). 18 May 2000 SGML2LATEX(1)
All times are GMT -4. The time now is 09:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy