Sponsored Content
Top Forums Shell Programming and Scripting Extract the string between 2 delimiters Post 303044298 by bob123 on Tuesday 18th of February 2020 09:28:11 AM
Old 02-18-2020
thanks for reply


that just prints bob


need to print to line above as in post one
 

10 More Discussions You Might Find Interesting

1. Solaris

To extract everything between two delimiters

My input file looks like " @$SCRIPT/atp_asrmt_adj.sql $SCRIPT/dba2000.scr -s / @$SCRIPT/cim1005w.pls $SCRIPT/dba2000.scr -s / @$SCRIPT/cim1006w.pls start $SCRIPT/cim1020d.sql;^M spool $DATA/cim1021m.sql @$DATA/cim1021m.sql ! rm $DATA/cim1021m.sql spool $DATA/cim1021m.sql... (1 Reply)
Discussion started by: dowsed4u8
1 Replies

2. UNIX for Advanced & Expert Users

extract text b/w two delimiters

I have an input file which looks like " @$SCRIPT/atp_asrmt_adj.sql $SCRIPT/dba2000.scr -s / @$SCRIPT/cim1005w.pls $SCRIPT/dba2000.scr -s / @$SCRIPT/cim1006w.pls start $SCRIPT/cim1020d.sql;^M spool $DATA/cim1021m.sql @$DATA/cim1021m.sql ! rm $DATA/cim1021m.sql spool $DATA/cim1021m.sql... (6 Replies)
Discussion started by: dowsed4u8
6 Replies

3. Shell Programming and Scripting

how to extract values b/w two delimiters

Hi, Please help me to extrat values b/w two delimiters. $ echo $abc i want to extract the value 12345 b/w %. (5 Replies)
Discussion started by: tsaravanan
5 Replies

4. Shell Programming and Scripting

sub-string extract between variable delimiters

I need to extract certain pieces from a string, wher delimiters may vary. For example A0 B0 C0 12345677 X0 Y0 Z0 A1-B1 C1 12345678 X1 Y0 Z0 A1/B2 C77 12345679 X2 Y0 Z0 I need to get C0 12345677 X0 C1 12345678 X1 C77 12345679 X2 I tried sed, see example below: echo 'A0 B0... (2 Replies)
Discussion started by: migurus
2 Replies

5. Shell Programming and Scripting

Getting a string without fixed delimiters

I have a line of text for example aaaa bbbb cccc dddd eeee ffffff I would need to get the cccc however bbbb could be there or not. So whether bbbb is in the line or not I need cccc. I was looking at either awk or sed....and trying to start at c and end until the next space. Also... (11 Replies)
Discussion started by: bombcan1
11 Replies

6. Shell Programming and Scripting

Extract strings within XML file between different delimiters

Good afternoon! I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Discussion started by: bab@faa
3 Replies

7. Shell Programming and Scripting

How to Replace string between delimiters?

Basically , i want to delete strings of a particular pattern from the flat file which is " | " pipe delimited. Below are the valid formats : 1) AAA (0) 111-111-111, AAA, BB 2) AAA (0) 111-111-1111;X, AAA, BB original flat file example : |ABC ABC XHAMK|AAA (0) 111-111-111, AAA,... (3 Replies)
Discussion started by: Ravi_007
3 Replies

8. Shell Programming and Scripting

Extract value between the delimiters and replace it with another value

Hi All, i have file name like below ABC_065224_123456_123456_your_130413_163005.txt ABC_065224_123456_MAIN_20130413_163005.txt ABC_065224_123456_123456_MAIN_130413_163005.txt ABC_065224_123456_123456_434567_MAIN_130413_163005.txt i need to find out the number of characters in the filed... (6 Replies)
Discussion started by: dssyadav
6 Replies

9. Shell Programming and Scripting

Skip the delimiter with in double quotes and count the number of delimiters during data extract

Hi All, I'm stuck-up in finding a way to skip the delimiter which come within double quotes using awk or any other better option. can someone please help me out. Below are the details: Delimited: | Sample data: 742433154|"SYN|THESIS MED CHEM PTY.... (2 Replies)
Discussion started by: BrahmaNaiduA
2 Replies

10. Shell Programming and Scripting

How to replace string between delimiters?

Hello, I would need to replace a delimiter in a flat file using.I would like to replace the semicolon (";") but only if it was contained in a string between quotes. For example: Original flat file example: abc;abc;"abc;abc";cd;"ef;ef";abc aa;bb;"aa";cc;"ddd;eee";ff Desired output:... (9 Replies)
Discussion started by: bartleby
9 Replies
alex(1mh)																 alex(1mh)

Name
       alex - extract addresses from message headers

Syntax
       alex [ +folder ] [ msgs ] [ options ]

Description
       The  address  line  extraction  utility	extracts electronic mail addresses from message headers and prints the addresses on your screen or
       places them, with a specified alias name, in an alias file.

       By default, searches for addresses in the current message in the current folder.  You can list the messages you wish  to  search  giving  a
       msgs argument.  You can also search messages in a different folder by giving a +folder argument.

       You  define  the  fields from which you want addresses by using combinations of field names with the -field option.  You can also supply an
       address yourself as a value to the -address option.  Results are printed either to your screen or to a file in format.  Where there  is	an
       address	group  in  the	alias  file  with  an alias name identical to one you have specified in an command, it may be replaced	or the new
       addresses appended.  A copy of the original alias file is kept.

       By default, searches the Reply-to:, Sender:, From: and To: header fields in that order until an address is found. You can set up  your  own
       default values for in your file; see

       When giving options to the command, generally the shortest unique abbreviation suffices.

Options
       -address string
		 Accepts  an  address  that  you  type in, rather than taking an address from a message.  If any -field option is specified, it is
		 ignored.

       -alias filename
		 Specifies the name of the alias file, in which aliases are placed.  You must provide a file name or a dash  (-)  as  an  argument
		 with  this  option.   There  is  no default value.  If the value given for this option is -, or the option is not specified, will
		 print the output to your screen.  If you do not give the full pathname of your alias file, will look for the alias file  in  your
		 Mail  directory, as specified in the Path field of your file.	If cannot locate the alias file in the directory that you specify,
		 it will ask you whether or not you wish to create one.

		 You can set up an alias file to be used by in your see for more information.  Like other mail commands, uses the Aliasfile  entry
		 to find the alias file.

       -compress
       -nocompress
		 Prevents  any repetition of the same address in the output of an command.  You can use this option when there are multiple occur-
		 rences of an address in an address group and you want just one occurrence of it in your alias.  The default is -nocompress.

       -field name[ /name ... ]
       -nofield  Specifies the name of a header field.	The name of the field is not case-sensitive.  If you specify this option without providing
		 an  argument,	the  default  values  are:  -field reply-to/sender/from/to.  You can set up your own default values for the -field
		 option in your See

		 Examples of field names are From, cc and To.  You must not type a colon after the name of a field.  When more field names follow,
		 in the form /name, the message header is searched for each of the fields in turn until one is found.  Only the first header field
		 found to contain an address is used; the rest are ignored.

		 The option -nofield excludes the named field.

		 The special name, all, means all fields, and can be used as a value for the -nofield option to  override  any	default  order	of
		 header fields, otherwise -field values are appended to any default values.

       -global	 Specifies  that  any  address replacements or appendings will apply to all occurrences of that alias name.  Normally, if an alias
		 name is entered in the alias file more than once, any actions performed by are performed only on the  first  occurrence  of  that
		 alias name.  The -global option ensures that any changes are made to all occurrences of the alias.  Whenever this option is spec-
		 ified, a message is broadcast to your screen telling you how many entries in the alias file have been changed.

       -help	 Prints a list of the valid options for this command.

       -name name
		 Specifies the alias name for address information extracted.  The command appends a colon (:) to the name as required by If you do
		 not  specify  this  option, will print extracted addresses to your screen.  If you specify this option, you must provide an argu-
		 ment; there is no default value.

       -query
       -noquery  Extracts addresses interactively.  Before adding each address of a list of extracted addresses to an alias group, the mail system
		 will ask you whether you wish the address to be added.  The query prompt is written on the standard error output.  The default is
		 -noquery.

       -replace
       -noreplace
		 Replaces existing alias with the new list of addresses.  By default, if there is an existing alias with the same name as the  one
		 you  are  trying  to  create, appends the new address list to the old alias.  If an address appears in both address groups, it is
		 still appended, so that it appears twice in the new alias.  You can specify this explicitly by using the -noreplace  option.	If
		 you specify the -replace option, the new list of addresses replaces the existing group.  The default is -noreplace.

       -width n  Specifies  the  maximum width of your alias file line.  If an alias group extends beyond this length, it is continued on the next
		 line, with a backslash () at end of the first line.  This option affects the format of each individual entry when it	is  imple-
		 mented; any subsequent or previous entries in the alias file remain the same.	The default is 72 characters.

Restrictions
       Because the -nofield option can take the value all as an argument, will not recognize a header field called All.  If you wish to use such a
       header field, you should call it X-all.

       If a command line contains contradictory arguments then the last value specified is used.  For example, in the following command, only uses
       the options -name fred and -noreplace:
       % alex -name sam -name fred -replace -noreplace

Examples
       This example takes the address from the From field of the current message, and places it in your alias file with the alias name bob:
       % alex -field from -alias aliases -name bob

       The  following  example	shows what happens if you specify an alias file that does not exist.  You are asked whether you want to create the
       file; enter y to create it:
       % alex -field from -name bob -alias aliases
       Create alias file "HOME/Mail/aliases"? y

       The next example takes addresses from two fields, From and cc, and saves them as the alias sales_team:
       % alex -field from -field cc -alias aliases -name sales_team

Files
       Your user profile.

See Also
       ali(1mh), mh(1mh), pick(1mh), mh-alias(5mh), mh_profile(5mh)

																	 alex(1mh)
All times are GMT -4. The time now is 05:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy