Sponsored Content
Top Forums UNIX for Dummies Questions & Answers extract text between two strings exclusive Post 302309653 by Franklin52 on Wednesday 22nd of April 2009 01:15:08 PM
Old 04-22-2009
Something like this?

Code:
sed -n '/secret=/ s/secret=//p'

Or:

Code:
awk -F"=" '/secret/{print $2}'

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using AWK how to extract text between two same strings

I have a file like: myfile.txt it is easy to learn awk and begin awk scripting and awk has got many features awk is a powerful text processing tool Now i want to get the text between first awk and immediate awk not the third awk . How to get it ? its urgent pls help me and file is unevenly... (2 Replies)
Discussion started by: santosh1234
2 Replies

2. Shell Programming and Scripting

using awk to extract text between two constant strings

Hi, I have a file from which i need to extract data between two constant strings. The data looks like this : Line 1 SUN> read db @cmpd unit 60 Line 2 Parameter: CMPD -> "C00071" Line 3 Line 4 SUN> generate Line 5 tabint>ERROR: (Variable data) The data i need to extract is... (11 Replies)
Discussion started by: mjoshi
11 Replies

3. UNIX for Dummies Questions & Answers

Using awk/sed to extract text between Strings

Dear Unix Gurus, I've got a data file with a few hundred lines (see truncated sample)... BEGIN_SCAN1 TASK_NAME=LA48 PDD Profiles PROGRAM=ArrayScan 1.00 21.220E+00 2.00 21.280E+00 END_DATA END_SCAN1 BEGIN_SCAN2 TASK_NAME=LA48 PDD Profiles 194.00 2.1870E+00 ... (5 Replies)
Discussion started by: tintin72
5 Replies

4. Shell Programming and Scripting

AWK: How to extract text lines between two strings

Hi. I have a text test1.txt file like:Receipt Line1 Line2 Line3 End Receipt Line4 Line5 Line6 Canceled Receipt Line7 Line8 Line9 End (9 Replies)
Discussion started by: TQ3
9 Replies

5. UNIX for Advanced & Expert Users

bash/grep/awk/sed: How to extract every appearance of text between two specific strings

I have a text wich looks like this: clid=2 cid=6 client_database_id=35 client_nickname=Peter client_type=0|clid=3 cid=22 client_database_id=57 client_nickname=Paul client_type=0|clid=5 cid=22 client_database_id=7 client_nickname=Mary client_type=0|clid=6 cid=22 client_database_id=6... (3 Replies)
Discussion started by: Pioneer1976
3 Replies

6. Shell Programming and Scripting

How to Extract text between two strings?

Hi, I want to extract some text between two strings in a line i am using following command i.e; awk '/-string1/,/-string2/' filename contents of file is--- line1 line2 aaa -bbb -ccc -string1 c,d,e -string2 line4 but it is showing complete line which is having searched strings. aaa... (19 Replies)
Discussion started by: emresearch
19 Replies

7. Shell Programming and Scripting

Extract text between two strings

Hi I have something like this: EXAMPLE 1 CREATE UNIQUE INDEX "STRING_1"."STRING_2" ON "BOSNI_CAB_EVENTO" ("CD_EVENTO" , "CD_EJECUCION" ) PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 5242880 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "DB1000_INDICES_512K"... (4 Replies)
Discussion started by: chrispaz81
4 Replies

8. Shell Programming and Scripting

Extract text between two strings

Hi, I have a text like these: ECHO "BEGGINING THE SHELL....." MV FILE1 > FILE2 UNIQ_ID=${1} PARTITION_1=`${PL}/Q${CON}.KSH "SELECT ....." PARTITION_2=`${PL}/Q${CON}.KSH "SELECT ........" ${PL}/Q${CON}.KSH "CREATE ...." IF .... ....... I would like to extract only text that only... (4 Replies)
Discussion started by: mierdatuti
4 Replies

9. UNIX for Dummies Questions & Answers

Issue when using egrep to extract strings (too many strings)

Dear all, I have a data like below (n of rows=400,000) and I want to extract the rows with certain strings. I use code below. It works if there is not too many strings for example n of strings <5000. while I have 90,000 strings to extract. If I use the egrep code below, I will get error: ... (3 Replies)
Discussion started by: forevertl
3 Replies

10. Shell Programming and Scripting

Need grep regex to extract multiline text between two strings

I have a file conatining the below: --- 10.9.16.116: /tmp/5835113081224811756.jar: hash: e6df90d38fa86f0e289f73d79cd2cfd2a29954eb /tmp/4603745991442278706.jar: hash: e6df90d38fa86f0e289f73d79cd2cfd2a29954eb 10.9.14.126: /tmp/conf/extra/httpd-ssl.conf: hash:... (1 Reply)
Discussion started by: mohtashims
1 Replies
SRS(1p) 						User Contributed Perl Documentation						   SRS(1p)

NAME
srs - command line interface to Mail::SRS SYNOPSIS
srs --alias=alias@forwarder.com --secretfile=/etc/srs_secret sender@source.com DESCRIPTION
The srs commandline interface will create an instance of Mail::SRS with parameters derived from the commandline arguments and perform forward or reverse transformations for all addresses given. It is usually invoked from a sendmail envelope address transformation rule, a qmail alias, or similar. See http://www.anarres.org/projects/srs/ for examples. Arguments take the form --name or --name=value. ARGUMENTS
--separator String, specified at most once. Defaults to $SRSSEP ("="). Specify the initial separator for the SRS address. See Mail::SRS for details. --address String, may be specified multiple times, must be specified at least once. Specify a sender address to transform. --secret String, may be specified multiple times, at least one of --secret or --secretfile must be specified. Specify an SRS secret. The first specified secret is used for encoding. All secrets are used for decoding. --secretfile String, specified at most once, at least one of --secret or --secretfile must be specified. A file to read for secrets. Secrets are specified once per line. The first specified secret is used for encoding. Secrets are written one per line. Blank lines and lines starting with a # are ignored. If --secret is not given, then the secret file must be nonempty. --secret will specify a primary secret and override --secretfile if both are specified. However, secrets read from --secretfile will still be used for decoding if both are specified. --forward No argument. Specifies a forwards transformation. This is the default. --reverse must not also be given. --reverse No argument. Specifies a reverse transformation. --forward must not also be given. --alias String, must be specified exactly once if doing forwards transformation. Provides the alias address to which the mail was sent. The domain-part of this address is used in the generated SRS address. The local-part and @ are optional and may be omitted. --hashlength Integer, may be specified at most once, defaults to 4. Specify the number of base64 characters to use for the cryptographic authentication code. --help Print some basic help. SEE ALSO
Mail::SRS, http://www.anarres.org/projects/srs/ AUTHOR
Shevek CPAN ID: SHEVEK cpan@anarres.org http://www.anarres.org/projects/ COPYRIGHT
Copyright (c) 2004 Shevek. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2004-06-23 SRS(1p)
All times are GMT -4. The time now is 11:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy