Sponsored Content
Full Discussion: sed substitute situation
Top Forums UNIX for Dummies Questions & Answers sed substitute situation Post 73682 by vibhor_agarwali on Friday 3rd of June 2005 09:02:01 AM
Old 06-03-2005
Ooops,

While I was writing somebody else gave the command. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed situation

Hi, I'm looking for someone who can think in sed. Basically, I need the trailing characters on every line in a file to be deleted. These characters are all in capitals, and always follow a number, but they often vary in number For instance, on the line: 2006_10_9_p20_TALK I'd want to... (4 Replies)
Discussion started by: Laurel Maury
4 Replies

2. Shell Programming and Scripting

Using SED to substitute between two patterns.

Hi All, I'm currently using SED to make various changes to some .xml files I'm working on, but I'm stuck on this particular problem. I want to remove '<placeholder>element-name</placeholder>' from the following: <heading>Element <placeholder>element-name</placeholder> not... (2 Replies)
Discussion started by: Steve_altius
2 Replies

3. Shell Programming and Scripting

Using sed to substitute first occurrence

I am trying to get rid of some ending tags but I run into some problems. Ex. How are you?</EndTag><Begin>It is fine.</Begin><New> Just about I am trying to get rid of the ending tags, starts with </ and ending with >. (which is </EndTag> and </Begin>) I tried the following sed... (2 Replies)
Discussion started by: quixoticking11
2 Replies

4. UNIX for Dummies Questions & Answers

Using sed to substitute between quotes.

I'm using sed to perform a simply search and replace. The typical data is: <fig><image href="Graphics/BAV.gif" align="left" placement="break" I need to replace the value in the first set of quotes, keeping the remainder of the line the same. Thus: <fig><image href="NEW_VALUE" align="left"... (3 Replies)
Discussion started by: Steve_altius
3 Replies

5. Shell Programming and Scripting

Sed question to substitute data in \2

Hi All, Here is what I'm trying to do with sed: Input File: somechangeVariable1=Something I would like to change somechangeVariable2=Something else I would like to change ... Output File: somechangeVariable1=Something I would like to different somechangeVariable2=Something else I would... (6 Replies)
Discussion started by: Peace_Dude1
6 Replies

6. Shell Programming and Scripting

how to substitute filepaths with sed or awk?

I am having the following problem. I am having a lot of files (test_1_01.hea, test_1_02.hea, etc) with the content: project_directory /net/1/d_1/5/ tmp_directory /net/1/d_1/5/ material_directory /net/1/d_1/5/ And I have to substitute the filepaths with new counted ones where the... (3 Replies)
Discussion started by: ergy1983
3 Replies

7. Shell Programming and Scripting

using sed or gsub to substitute characters!

Is there a way to substitute the URL-encoding references of ( & and ` ) with their actual appearance? for example.... %26 is & say I want to convert every %26 in my file to &..... awk '{gsub(/%26/,"&");print}' Is there a way to do this? I also want to be able to convert ` too! (3 Replies)
Discussion started by: puttster
3 Replies

8. Shell Programming and Scripting

sed substitute command -- need help

I am trying to do what I thought should be a simple substitution, but I can't get it to work. File: Desire output: I thought I'd start with a sed command to remove the part of the header line preceding the string "comp", then go on to remove the suffix of the target string (e.g. ":3-509(-)"),... (3 Replies)
Discussion started by: pathunkathunk
3 Replies

9. Shell Programming and Scripting

[sed]: Substitute a string with a multiline value

Dear all, I try to replace a string of characters in a file (MyFile.txt) by a multiline value of the variable "Myvar": $ cat MyFile.txt DESCRIPTION '@TargetTable SCHEMA' ( @InputFlowDef ); $ The content of Myvar: $ echo "$Myvar" col1 , col2 , col3 $ (4 Replies)
Discussion started by: dae
4 Replies

10. UNIX for Beginners Questions & Answers

Substitute a character with sed

hi all, i'd like to modify a file with sed , i want to substuite a char "-" with "/" how can i do this? Thanks for all regards Francesco (16 Replies)
Discussion started by: Francesco_IT
16 Replies
COLLDEF(1)						    BSD General Commands Manual 						COLLDEF(1)

NAME
colldef -- convert collation sequence source definition SYNOPSIS
colldef [-I map_dir] [-o out_file] [filename] DESCRIPTION
The colldef utility converts a collation sequence source definition into a format usable by the strxfrm() and strcoll() functions. It is used to define the many ways in which strings can be ordered and collated. The strxfrm() function transforms its first argument and places the result in its second argument. The transformed string is such that it can be correctly ordered with other transformed strings by using strcmp(), strncmp(), or memcmp(). The strcoll() function transforms its arguments and does a comparison. The colldef utility reads the collation sequence source definition from the standard input and stores the converted definition in filename. The output file produced contains the database with collating sequence information in a form usable by system commands and routines. The following options are available: -I map_dir Set directory name where charmap files can be found, current directory by default. -o out_file Set output file name, LC_COLLATE by default. The collation sequence definition specifies a set of collating elements and the rules defining how strings containing these should be ordered. This is most useful for different language definitions. The specification file can consist of three statements: charmap, substitute and order. Of these, only the order statement is required. When charmap or substitute is supplied, these statements must be ordered as above. Any statements after the order statement are ignored. Lines in the specification file beginning with a '#' are treated as comments and are ignored. Blank lines are also ignored. charmap charmapfile Charmap defines where a mapping of the character and collating element symbols to the actual character encoding can be found. The format of charmapfile is shown below. Symbol names are separated from their values by TAB or SPACE characters. Symbol-value can be specified in a hexadecimal (x??) or octal (???) representation, and can be only one character in length. symbol-name1 symbol-value1 symbol-name2 symbol-value2 ... Symbol names cannot be specified in substitute fields. The charmap statement is optional. substitute "symbol" with "repl_string" The substitute statement substitutes the character symbol with the string repl_string. Symbol names cannot be specified in repl_string field. The substitute statement is optional. order order_list Order_list is a list of symbols, separated by semi colons, that defines the collating sequence. The special symbol ... specifies, in a short-hand form, symbols that are sequential in machine code order. An order list element can be represented in any one of the following ways: o The symbol itself (for example, a for the lower-case letter a). o The symbol in octal representation (for example, 141 for the letter a). o The symbol in hexadecimal representation (for example, x61 for the letter a). o The symbol name as defined in the charmap file (for example, <letterA> for letterA 23 record in charmapfile). If character map name have > character, it must be escaped as />, single / must be escaped as //. o Symbols a, , f, , , v are permitted in its usual C-language meaning. o The symbol chain (for example: abc, <letterA><letterB>c, xf1bxf2) o The symbol range (for example, a;...;z). o Comma-separated symbols, ranges and chains enclosed in parenthesis (for example ( sym1, sym2, ... )) are assigned the same primary order- ing but different secondary ordering. o Comma-separated symbols, ranges and chains enclosed in curly brackets (for example { sym1, sym2, ... }) are assigned the same primary ordering only. The backslash character is used for continuation. In this case, no characters are permitted after the backslash character. DIAGNOSTICS
The colldef utility exits with the following values: 0 No errors were found and the output was successfully created. !=0 Errors were found. FILES
/usr/share/locale/<language>/LC_COLLATE The standard shared location for collation orders under the locale <language>. SEE ALSO
mklocale(1), setlocale(3), strcoll(3), strxfrm(3) BSD
January 27, 1995 BSD
All times are GMT -4. The time now is 03:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy