Sponsored Content
Top Forums Shell Programming and Scripting How to remove all text except pattern Post 302384277 by durden_tyler on Monday 4th of January 2010 05:29:09 PM
Old 01-04-2010
Can you post the output of the following command over here ?

Code:
echo $text

tyler_durden

Also, are the "2000+ symbols" -
(a) special, but printable, characters like "@", "$", "%" etc. or
(b) non-printable characters like those for ASCII 0, 1, 2, etc.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

process text between pattern and print other text

Hi All, The file has the following. =========start of file=== This is a file containing employee info START name john id 123 date 12/1/09 END START name sam id 4234 date 12/1/08 resigned END (9 Replies)
Discussion started by: vlinet
9 Replies

2. Shell Programming and Scripting

sed: Find start of pattern and extract text to end of line, including the pattern

This is my first post, please be nice. I have tried to google and read different tutorials. The task at hand is: Input file input.txt (example) abc123defhij-E-1234jslo 456ujs-W-abXjklp From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Discussion started by: TestTomas
5 Replies

3. Shell Programming and Scripting

Help with remove last text of a file that have specific pattern

Input file matrix-remodelling_associated_8_ aurora_interacting_1_ L20 von_factor_A_domain_1 ATP_containing_3B_ . . Output file matrix-remodelling_associated_8 aurora_interacting_1 L20 von_factor_A_domain_1 ATP_containing_3B . . (3 Replies)
Discussion started by: perl_beginner
3 Replies

4. Shell Programming and Scripting

Remove last pattern

I have a file with entries below. domain1.com.http: domain2.com.49503: I need this to be sorted like below. ie remove the patten after the last right-hand side . (dot). domain1.com domain2.com (7 Replies)
Discussion started by: anil510
7 Replies

5. Shell Programming and Scripting

Search a pattern in a line and remove another pattern

Hi, I want to search a pattern in a text file and remove another pattern in that file. my text file look like this 0.000000 1.970000 F 303 - 1.970000 2.080000 VH VH + 2.080000 2.250000 VH VH + 2.250000 2.330000 VH L - 2.330000 2.360000 F H + 2.360000 2.410000 L VL - 2.410000 ... (6 Replies)
Discussion started by: sreejithalokkan
6 Replies

6. Shell Programming and Scripting

Remove duplicate occurrences of text pattern

Hi folks! I have a file which contains a 1000 lines. On each line i have multiple occurrences ( 26 to be exact ) of pattern folder#/folder#. # is depicting the line number in the file some text here folder1/folder1 some text here folder1/folder1 some text here folder1/folder1 some text... (7 Replies)
Discussion started by: martinsmith
7 Replies

7. Shell Programming and Scripting

Remove comments like pattern from text

Hi , We need to remove comment like pattern from a code text. The possible comment expressions are as follows. Input BizComment : Special/*@ Name:bzt_53_3aea640a_51783afa_5d64_0 BizHidden:true @*/ /* lookup Disease Category Therapuetic Class */ a=b;... (6 Replies)
Discussion started by: VikashKumar
6 Replies

8. UNIX for Advanced & Expert Users

How to remove a char before a pattern?

Hi I have a file where i want to remove a char before a specific pattern. exp: CREATE TABLE ( A, B, C, ----comma needs to be removed )AS SELECT A, B, C, ----comma needs to be removed FROM TABLE. So i want to delete the comma(,) after the C both ways.Pattern can be... (11 Replies)
Discussion started by: raju2016
11 Replies

9. Shell Programming and Scripting

How to remove the text between all curly brackets from text file?

Hello experts, I have a text file with lot of curly brackets (both opening { & closing } ). I need to delete them alongwith the text between opening & closing brackets' pair. For ex: Input:- 59. Rh1 Qe4 {(Qf5-e4 Qd8-g8+ Kg6-f5 Qg8-h7+ Kf5-e5 Qh7-e7+ Ke5-f5 Qe7-d7+ Qe4-e6 Qd7-h7+ Qe6-g6... (6 Replies)
Discussion started by: prvnrk
6 Replies

10. UNIX for Beginners Questions & Answers

awk to remove pattern and lines above pattern

In the awk below I am trying to remove all lines above and including the pattern Test or Test2. Each block is seperated by a newline and Test2 also appears in the lines to keep but it will always have additional text after it. The Test to remove will not. The awk executed until the || was added... (2 Replies)
Discussion started by: cmccabe
2 Replies
MKLOCALE(1)						    BSD General Commands Manual 					       MKLOCALE(1)

NAME
mklocale -- make LC_CTYPE locale files SYNOPSIS
mklocale [-d] < src-file > language/LC_CTYPE mklocale [-d] -o language/LC_CTYPE src-file DESCRIPTION
The mklocale utility reads a LC_CTYPE source file from standard input and produces a LC_CTYPE binary file on standard output suitable for placement in /usr/share/locale/language/LC_CTYPE. The format of src-file is quite simple. It consists of a series of lines which start with a keyword and have associated data following. C style comments are used to place comments in the file. Following options are available: -d Turns on debugging messages. -o Specify output file. Besides the keywords which will be listed below, the following are valid tokens in src-file: RUNE A RUNE may be any of the following: 'x' The ASCII character x. 'x' The ANSI C character x where x is one of a, , f, , , , or v. 0x[0-9a-z]* A hexadecimal number representing a rune code. 0[0-7]* An octal number representing a rune code. [1-9][0-9]* A decimal number representing a rune code. STRING A string enclosed in double quotes ("). THRU Either ... or -. Used to indicate ranges. literal The follow characters are taken literally: <([ Used to start a mapping. All are equivalent. >)] Used to end a mapping. All are equivalent. : Used as a delimiter in mappings. Key words which should only appear once are: ENCODING Followed by a STRING which indicates the encoding mechanism to be used for this locale. The current encodings are: ASCII American Standard Code for Information Interchange. BIG5 The ``Big5'' encoding of Chinese. EUC EUC encoding as used by several vendors of UNIX systems. GB18030 PRC national standard for encoding of Chinese text. GB2312 Older PRC national standard for encoding Chinese text. GBK A widely used encoding method for Chinese text, backwards compatible with GB 2312-1980. MSKanji The method of encoding Japanese used by Microsoft, loosely based on JIS. Also known as ``Shift JIS'' and ``SJIS''. NONE No translation and the default. UTF-8 The UTF-8 transformation format of ISO 10646 as defined by RFC 2279. VARIABLE This keyword must be followed by a single tab or space character, after which encoding specific data is placed. Currently only the EUC encoding requires variable data. See euc(5) for further details. INVALID (obsolete) A single RUNE follows and is used as the invalid rune for this locale. The following keywords may appear multiple times and have the following format for data: <RUNE1 RUNE2> RUNE1 is mapped to RUNE2. <RUNE1 THRU RUNEn: RUNE2> Runes RUNE1 through RUNEn are mapped to RUNE2 through RUNE2 + n-1. MAPLOWER Defines the tolower mappings. RUNE2 is the lower case representation of RUNE1. MAPUPPER Defines the toupper mappings. RUNE2 is the upper case representation of RUNE1. TODIGIT Defines a map from runes to their digit value. RUNE2 is the integer value represented by RUNE1. For example, the ASCII character '0' would map to the decimal value 0. Only values up to 255 are allowed. The following keywords may appear multiple times and have the following format for data: RUNE This rune has the property defined by the keyword. RUNE1 THRU RUNEn All the runes between and including RUNE1 and RUNEn have the property defined by the keyword. ALPHA Defines runes which are alphabetic, printable and graphic. CONTROL Defines runes which are control characters. DIGIT Defines runes which are decimal digits, printable and graphic. GRAPH Defines runes which are graphic and printable. LOWER Defines runes which are lower case, printable and graphic. PUNCT Defines runes which are punctuation, printable and graphic. SPACE Defines runes which are spaces. UPPER Defines runes which are upper case, printable and graphic. XDIGIT Defines runes which are hexadecimal digits, printable and graphic. BLANK Defines runes which are blank. PRINT Defines runes which are printable. IDEOGRAM Defines runes which are ideograms, printable and graphic. SPECIAL Defines runes which are special characters, printable and graphic. PHONOGRAM Defines runes which are phonograms, printable and graphic. SWIDTH0 Defines runes with display width 0. SWIDTH1 Defines runes with display width 1. SWIDTH2 Defines runes with display width 2. SWIDTH3 Defines runes with display width 3. If no display width explicitly defined, width 1 assumed for printable runes by default. SEE ALSO
colldef(1), setlocale(3), wcwidth(3), big5(5), euc(5), gb18030(5), gb2312(5), gbk(5), mskanji(5), utf8(5) HISTORY
The mklocale utility first appeared in 4.4BSD. BUGS
The mklocale utility is overly simplistic. BSD
October 17, 2004 BSD
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy