Sponsored Content
Top Forums UNIX for Dummies Questions & Answers vi Search for text, Replace with <CR> or control character. Post 302318153 by zedex on Thursday 21st of May 2009 12:42:28 AM
Old 05-21-2009
Quote:
Code:
:1,$s/ -I/\r/g

Code:
you can replace 1,$ by % - indicates replace on all lines 
%s/-I/\r/g

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

2. UNIX for Dummies Questions & Answers

search and replace a specific text in text file?

I have a text file with following content (3 lines) filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies

3. Shell Programming and Scripting

Need to search and replace based on character count

Hi, I wanted to add a newline character after every 100 characters in a file using a awk or shell without reading each line of the file. I want to run a command on the complete file. This does based on a string but i want to add a new line after every 100 characters ir-respective of the... (3 Replies)
Discussion started by: vijaykrc
3 Replies

4. Shell Programming and Scripting

Replace any control character in the string

Need to replace any control character in the string in perl ---------- Post updated at 04:22 PM ---------- Previous update was at 03:50 PM ---------- Any help !!! Thanks in advance (2 Replies)
Discussion started by: hansini
2 Replies

5. Shell Programming and Scripting

Search and replace text

Hello, I am trying to search and replace but I don't know how to do it. My simple knowlegde in search and replace using sed is not helping me at all. File: its a cause value #22: dfg ggg Cause value #1: aasfa fasdf asfa value #22: affg gggg Basically i want to replace the... (6 Replies)
Discussion started by: balan1983a
6 Replies

6. Shell Programming and Scripting

Regex:search/replace but not for escaped character

Hi Input: - -- --- ---- aa-bb-cc aa--bb--cc aa---bb---cc aa----bb----cc Output: . - -. -- aa.bb.cc (7 Replies)
Discussion started by: chitech
7 Replies

7. Shell Programming and Scripting

Replace Control M (^M) character with new line

Hi All, We are getting an external file in abc.csv format. When opened in excel spread sheet, it is opening alright. But when opened in notepad, I see the contents in a single line. Ftp'd the file in binary mode to AIX UNIX host. When opened, I see Control M (^M) characters in place of New Line... (16 Replies)
Discussion started by: njny
16 Replies

8. UNIX for Dummies Questions & Answers

Search for a particular word and replace the first character

Hi Unix gurus, I've a dna sequence in a file format known as fasta format (sequence header starts with > and ignored), an example shown below: >sequence_1 CGTATTCTCCGAATACC ATACG >sequence_2 CAGATTTTCAAATACCCCC In a file like this I want to do the following three search and replace. The... (4 Replies)
Discussion started by: Fahmida
4 Replies

9. Shell Programming and Scripting

Search a character and replace it with multiple lines

This is for AIX 6.1, I've a flat file and the format is like this DECLARE some statements; BEGIN some statements; END; I've to search BEGIN and replace it with the following 4 lines BEGIN For x in 1..1 LOOP BEGIN Similarly I've to search END and replace it with the... (7 Replies)
Discussion started by: Mukul Sharma
7 Replies

10. Post Here to Contact Site Administrators and Moderators

Search for a pattern and replace a space at specific position with a Character in File

In file, we have millions of records each of 1000 in length. And at specific position say 800 there is a space, we need to replace it with Character X if the ID in that row starts with 123. So far i have used the below which is replacing space at that position to X but its not checking for... (3 Replies)
Discussion started by: Jagmeet Singh
3 Replies
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-11-04 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 06:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy