Sponsored Content
Top Forums Shell Programming and Scripting Copying lines between two strings Post 302739813 by michaelrozar17 on Wednesday 5th of December 2012 02:33:31 AM
Old 12-05-2012
Or with Sed..
Code:
$ uname -rs
SunOS 5.10
$ sed -n '/First/{
> :l
> n
> /Second/{
> q
> }
> p; bl
> }' wer
Some_Other_String ....
Some_Other_String ....
Some_Other_String ....
$

Alternate awk..
Code:
nawk '/First/,/Second/{a=/First|Second/?0:1}a' inputfile


Last edited by michaelrozar17; 12-05-2012 at 03:46 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

copying strings...

hey i want to know the unix command for copying 1 string to another and allso adding a third string to the result. for eg: a b="nbno" c="uioio" i want to copy contents of b to a and the append the contents of c to the contents of a and the result shud be in string a (1 Reply)
Discussion started by: priya_9patil
1 Replies

2. UNIX for Dummies Questions & Answers

Copying common lines to a new file

How do i copy the common lines between 2 files to another file? for example file1: asdfg sdf gdsf file2: asdfgh asd sdf xcv file3: sdf (3 Replies)
Discussion started by: khestoi
3 Replies

3. Shell Programming and Scripting

using AWK see the upper lines and lower lines of the strings??

Hi experts, You cool guys already given me the awk script below- awk '/9366109380/,printed==5 { ++printed; print; }' 2008-09-14.0.log Morever, i have one more things- when i awk 9366109380, i can also see the Upper 3 lines as well as below 5 lines of that string. Line 1.... (3 Replies)
Discussion started by: thepurple
3 Replies

4. Shell Programming and Scripting

Grep and delete lines except the lines with strings

Hi I am writing a script which should read a file and search for certain strings 'approved' or 'removed' and retain only those lines that contain the above strings. Ex: file name 'test' test: approved package waiting for approval package disapproved package removed package approved... (14 Replies)
Discussion started by: vj8436
14 Replies

5. Shell Programming and Scripting

Removing empty lines(space) between two lines containing strings

Hi, Please provide shell script to Remove empty lines(space) between two lines containing strings in a file. Input File : A1/EXT "BAP_BSC6/07B/00" 844 090602 1605 RXOCF-465 PDTR11 1 SITE ON BATTERY A2/EXT... (3 Replies)
Discussion started by: sudhakaryadav
3 Replies

6. Shell Programming and Scripting

Copying of multiple columns of one table to another by mapping with particular strings.

Hi, I would like to copy some columns from a particular file by mapping with the string names. i am using the .csv file format. my one file consist of 100 of columns but i want only particular 4 columns such as ( First_name, Middle_name,Last_name & Stlc). but they are listed in many files... (15 Replies)
Discussion started by: dsh007
15 Replies

7. Shell Programming and Scripting

Delete lines in file containing duplicate strings, keeping longer strings

The question is not as simple as the title... I have a file, it looks like this <string name="string1">RZ-LED</string> <string name="string2">2.0</string> <string name="string2">Version 2.0</string> <string name="string3">BP</string> I would like to check for duplicate entries of... (11 Replies)
Discussion started by: raidzero
11 Replies

8. Shell Programming and Scripting

Numbering, copying and replacing strings

hello everybody there, I'm a new bash shell programmer and I'm dealing with a problem. To start, I have a file with a number of string lines which may contain a particular string or not. I have to write a code that identifies the line containing one particular string and keeps it, but also writes... (10 Replies)
Discussion started by: leaf
10 Replies

9. Shell Programming and Scripting

Help with copying lines from different files.

I am new to Linux and have a challenging task. I have 3 data files, and need to do the following: Go to line 31 of file 1, delete it Read 1 line from file 2 and add in place of deleted line Go to line 97 of file I delete it and then read the line 1 from file 2 and add in place of that... (2 Replies)
Discussion started by: hamnsan
2 Replies

10. Shell Programming and Scripting

Copying few lines from one file to another

Hi all I have a requirement I need to copy only first 2 lines from a file of one location to another file of same location I used to code as cp head -2 abc 123 But i get the following error cp: 0653-437 123 is not a directory. The files used are cat abc ABCD EFDG TYUI (5 Replies)
Discussion started by: Priya Amaresh
5 Replies
Locale::Codes::LangFam(3)				User Contributed Perl Documentation				 Locale::Codes::LangFam(3)

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.16.3 2013-02-27 Locale::Codes::LangFam(3)
All times are GMT -4. The time now is 01:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy