Sponsored Content
Full Discussion: Character replacement
Top Forums Shell Programming and Scripting Character replacement Post 302135119 by deaconf19 on Thursday 6th of September 2007 02:48:52 AM
Old 09-06-2007
you could do within vi the global repleace

:g/c2/s//c5/g

this replaces everything with c2 to c5. you could some how work this into a script to do a larger directory if you do not feel like vi a file. not sure though
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed in character replacement in Korn Shell

How do I replace a space " " character at a particular position in a line? e.g. I have a file below $ cat i2 111 002 A a 33 0011 B c 2222 003 C a I want all the 1st spaces to be replaced with forward slash "/" and the 3rd spaces to have 5 spaces to get the output below: 111/002... (8 Replies)
Discussion started by: stevefox
8 Replies

2. Shell Programming and Scripting

KSH - Character Replacement

Hey all. Easy question. I have a (ksh) varaible x. It contains the following (for example): N557788 I want to replace the "N" with a "-". I've done this before but for the life of me I cannot remember how I did it. Thanks. mtw (2 Replies)
Discussion started by: mixxamike
2 Replies

3. Shell Programming and Scripting

Sed-Special character replacement

Hi I want to replace ./testsed.ksh with testsed.ksh ./ is to be removed scriptnm=`sed -e 's/\.///' $0 does not work Please help (3 Replies)
Discussion started by: usshell
3 Replies

4. UNIX for Dummies Questions & Answers

banner character replacement

Can we able to replace the character # in banner command with some other characters. Can we able to blink the character in Kornshell (1 Reply)
Discussion started by: sivakumar.rj
1 Replies

5. Programming

python, character replacement

Hello, I need to do this in python but I'm just learning py and it's quite urgent. I have a script I created and need an interactive python script to modify part of a line. MY SCRIPT #ligand prep. Uses 'ind' prefix. The initial ligand must be ind.pdb. This #generates ind.pdbqt.... (0 Replies)
Discussion started by: gav2251
0 Replies

6. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

7. UNIX for Dummies Questions & Answers

global search and replacement of a non-ascii character

Hi, I need to do a global search and replacement of a non-ascii character. Let me first give the background of my problem. Very frequently, I need to copy set of references from different sources. Typically, a reference would like this: Banumathy et al., 2002 G. Banumathy, V. Singh and U.... (1 Reply)
Discussion started by: effjay
1 Replies

8. Shell Programming and Scripting

sed - replacement file path with variable - Escaping / character

Hi,, I have the line below in a file: $!VarSet |LFDSFN1| = '"E:\APC\Trials\20140705_427_Prototype Trial\Data\T4_20140705_Trial_Cycle_Data_13_T_Norm.txt" "VERSION=100 FILEEXT=\"*.txt\" FILEDESC=\"General Text\" "+""+"TITLE{SEARCH=NONE NAME=\"New Dataset\" LINE=1I want to write a script to change... (2 Replies)
Discussion started by: carlr
2 Replies

9. Shell Programming and Scripting

Trigger email from script if the Special Character replacement is successfull

Hello Gurus, I have a script developed... #!/bin/bash #--------------------------------------------------------------------- # This pScript will remove/replace the special characters fromfiles #--------------------------------------------------------------------- trxdate="`date... (1 Reply)
Discussion started by: nanduedi
1 Replies

10. Shell Programming and Scripting

Special character replacement

Hi Guys, I have a file which needs to be replaced with tab delimited AA§Orgin Name§Mapping based on prod_usa§§§§ BB§Date§2019-08-11 23:30:01§§§§ I am trying below code sed 's// /g' test.txt Expected AA|Orgin Name|Mapping based on prod_usa||| BB|Date|2019-08-11 23:30:01|||| (6 Replies)
Discussion started by: rohit_shinez
6 Replies
neqn(1) 						      General Commands Manual							   neqn(1)

NAME
neqn, checkeq - Typesets mathematical equations and expressions SYNOPSIS
neqn [-dxy] [-pn] [-sn] [-fn] [file...] | nroff... checkeq [file...] DESCRIPTION
The neqn command is an nroff(1) preprocessor for displaying mathematical symbols and equations on terminals. Usage almost always involves preprocessing an nroff source file with neqn and then piping the output through nroff. Note The neqn command formatting works best on typesetting devices. Your terminal might not be equipped to display equations and other math symbols in a meaningful way. In fact, you might have difficulty viewing the symbols and examples included in this reference page. If no files are specified, neqn reads from the standard input. A line beginning with marks the start of an equation; at the beginning of a line marks the end of an equation. Neither of these lines is altered, so they can be defined in macro packages to produce centering, num- bering, and so on. It is also possible to set two characters as delimiters; subsequent text between delimiters is also treated as input to neqn. Delimiters may be set to any two characters, such as x and y, with the command-line argument -dxy or more commonly by placing delim xy between and be identical. Delimiters are turned off by delim off. All text that is neither between delimiters nor between and is passed through untouched. The program checkeq reports missing or unbalanced delimiters and pairs. Tokens within neqn are separated by spaces, tabs, newlines, braces, double quotation marks, tildes, or circumflexes. Braces { } are used for grouping. Generally speaking, anywhere a single character could appear, a complicated construction enclosed in braces can be used instead. The tilde (~) represents a full space in the output; the circumflex (^) half as much. Subscripts and superscripts are produced with the keywords sub and sup. Fractions use the keyword over. The sqrt keyword creates square roots. The keywords from and to are used to express lower and upper limits. Left and right brackets, braces, and so forth that encompass more than one line are created with the left and right keywords and tildes. Legal characters to use with left and right are {, }, [, ], |, c (ceiling), f (floor), and , meaning `nothing' (to use with the left key- word when you want brackets or braces on the right side only). The right keyword clause is optional. Vertical piles of things are made with pile, lpile, rpile, and cpile. There can be an arbitrary number of elements in a pile. You use lpile to left-justify a vertical grouping and rpile to right-justify one. The pile and cpile keywords create centered piles but have dif- ferent vertical spacing. You use the matrix keyword to create matrixes. The lcol, ccol, and col keywords are used with matrix to specify the alignment within the matrix; that is a left-justified column, centered column, and right-justified column, respectively. Diacritical marks are made with the following keywords: dot Produces a period (.) over the character preceding the key- word. dotdot Produces two periods (..) over the character preceding the keyword. hat Produces a circumflex (^) over the character preceding the keyword. tilde Produces a tilde (~) over the character preceding the key- word. bar Produces a horizontal bar over the character preceding the keyword. vec Produces a left-pointing arrow over the character preceding the keyword. dyad Produces a bidirectional arrow over the character preceding the keyword. under Produces an underscore under the character preceding the keyword. Size and font changes are made with the following keywords: size n Specifies the size as n points. size+n Increases the size n points. size-n Decreases the size n points. roman Uses roman type font. italic Uses italic type font. bold Uses bold type font. font n Uses the specified type font. Size and font can be changed globally in a document by using the gsize n and the gfont n keyword expressions or by the command-line argu- ments -s n and -f n. Normally subscripts and superscripts are reduced by three point sizes from the previous size. You can change this default with the -p n command-line argument. To aline successive display arguments, place the mark keyword before the desired lineup point in the first equation. Then place the lineup keyword at the place that is to line up vertically in subsequent equation lines. New keywords or new forms of existing keywords can be defined with the define keyword. For example, the following define expression defines the new keyword cc to be C Language: define cc % C Language % Whenever cc appears in the source file, processing with neqn causes C Language to appear in the preprocessed or output file. Note that the delimiting character surrounding the replacement string can be any character as long as it does not appear in the replacement string itself. The following keywords are also recognized for typeset output: sum Produces a large Greek sigma indicating summation. int Produces an integration sign. inf Produces an infinity sign. >= Produces a greater-than-or-equals sign. <= Produces a less-than-or-equals sign. -> Produces a right pointing arrow. <- Produces a left pointing arrow. != Produces a not equal sign. Greek letters are spelled out in the desired case, for example, alpha or GAMMA. Mathematical words like sin, cos, log are output in roman type automatically. Strings enclosed in double quotation marks ("...") are passed through untouched; this feature permits keywords to be entered as text. RESTRICTIONS
To embolden digits, parentheses, and so on, you must enclose them in quotation marks after the keyword bold. For example: bold "12.3". EXAMPLES
Input and output for x with subscript i: x sub i -> x i Input and output for x with subscript i and superscript 2: x sub i sup 2 -> x2 i Input and output for e with a superscript of x squared plus y squared: 2 2 x +y e sup {x sup 2 + y sup 2} -> e Input and output for the fraction q over r: q q over r -> _ r Input and output for the fraction of 1 over the square root of a polynomial that includes a superscript: 1 1 over sqrt {as sup 2 +bx+c} -> _________ 2 |ax +bx+c Input and output for an expression with a lower and upper limit: n lim from {n-> inf } sum from 0 to n x sub i -> lim Rxi n->oo0 Input and output for an expression with large left and right braces: { 2 y } _2 left {x sup 2 = y sup 2 over alpha right} ~=~ 1 -> {x +A } = 1 { } Input and output for a "pile" expression: a pile { a above b above c } -> b c Input and output for an expression with a matrix: matrix {lcol { x sub i above y sub 2 } ccol { 1 above 2 }} -> x 1 i y 2 2 SEE ALSO
nroff(1), tbl(1), ms(5) neqn(1)
All times are GMT -4. The time now is 05:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy