Sponsored Content
Full Discussion: Multiple Substring Outputs
Top Forums UNIX for Dummies Questions & Answers Multiple Substring Outputs Post 302413475 by Levenson on Thursday 15th of April 2010 11:34:28 PM
Old 04-16-2010
Maybe something like that? I'm not sure if it will work with a file. Test it.

Code:
echo "<ComponentName> something </ComponentName> asdfdf werwer <ElapsedTime>362</ElapsedTime>" | grep -o -E '((<ComponentName>)(.*)(</ComponentName>))|((<ElapsedTime>)(.*)(</ElapsedTime>))' | tr  "<|>|/" "\t" | awk '{print $2}' | fmt -s

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

compare 2 outputs

Hello, I have a shell script that is used as follows: ./script -s <Oracle_server_name> the script returns several lines in this format: parameter name required value Current Value comments --------------- ------------- -------------- --------- My objective now is to compare 2... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies

2. Shell Programming and Scripting

How to store multiple outputs from an awk command?

x=`echo $line | awk -F "|" '{print $1;print NR}'` How will I get the 2 return values ($1 and NR) from awk to variables? (4 Replies)
Discussion started by: tene
4 Replies

3. Shell Programming and Scripting

create outputs from other command outputs

hi friends, The code: i=1 while do filename=`/usr/bin/ls -l| awk '{ print $9}'` echo $filename>>summary.csv #Gives the name of the file stored at column 9 count=`wc -l $filename | awk '{print $1}'` echo $count>>summary.csv #Gives just the count of lines of file "filename" i=`expr... (1 Reply)
Discussion started by: rajsharma
1 Replies

4. UNIX for Dummies Questions & Answers

multiple variables assignement (stdout/stderr outputs)

Hi all, I've been looking around for this for a while and can't seem to find a satifactory way to do what I want: I would like to assign the output of stdout to a variable and that of stderr to another one, and this without using temporary files/named pipes. In other words be able to assign... (4 Replies)
Discussion started by: anthalamus
4 Replies

5. Shell Programming and Scripting

simple join for multiple files and produce 3 outputs

sh script file1 filea fileb filec ................filez. >>output1 & output2 &output3 file1 z10 1873 1920 z_number1_E59 z10 2042 2090 z_number2_E59 Z22 2476 2560 z_number3_E59 Z22 2838 2915 z_number4_E59 z1 1873 1920 z_number1_E60 z1 ... (9 Replies)
Discussion started by: stateperl
9 Replies

6. Shell Programming and Scripting

awk with multiple regex and substring

Hi Experts, I have a file on which i want to print the line which should match following criterias. Line should not start with 0 or 9 and Line should start with 1 and ( 576th character should not be 1 or 2 or 576-580 postion should not be NIPPF or CDIPB or 576-581 postion should... (2 Replies)
Discussion started by: millan
2 Replies

7. Shell Programming and Scripting

Array in awk outputs multiple values

Disclaimer: OP is 100% Awk beginner. I use this code on ASCII files I need to report against. awk 'BEGIN { tokens = 0 tokens = 0 tokens = 0 } { for (token in tokens) { if ($1 == token){print $0; tokens++;}}} END {for (token in tokens){ if( tokens ==... (1 Reply)
Discussion started by: alan
1 Replies

8. UNIX for Dummies Questions & Answers

Writing multiple outputs in to separate cells of CSV file

Hi I am writing a script which has multiple awk statements and each statement gives me a numeric count as an output. I want those output to be stored in different cells of a csv file. say 12 awk statements give 12 output and i want them in diffrenet cells of csv file. Thank you guys..!! (4 Replies)
Discussion started by: prabhat.diwaker
4 Replies

9. Shell Programming and Scripting

Returning multiple outputs of a single line based on previous repeated lines

Hello, I am trying to return a time multiple times from a file that has varying output just before the time instance, i.e. cat jumped cat jumped cat jumped time = 1.1 cat jumped cat jumped time = 1.2 cat jumped cat jumped time = 1.3 In this case i would like to output a time.txt... (6 Replies)
Discussion started by: ryddner
6 Replies

10. Shell Programming and Scripting

Consolidating multiple outputs in one file

Dears, i am stuck here i have 3 scripts running at one time and all the three scripts finish at different time and each script generate 1 file with different name. so i will have three files. i dnt know which script finish first i want to have a script which check if all the there files are... (6 Replies)
Discussion started by: mirwasim
6 Replies
ctags(1)						      General Commands Manual							  ctags(1)

Name
       ctags - create a tags file

Syntax
       ctags [options] name...

Description
       The command makes a tags file for from the specified C, Pascal and Fortran sources.

       A tags file gives the locations of specified objects (in this case functions and typedefs) in a group of files.	Each line of the tags file
       contains the object name, the file in which it is defined, and an address specification for the object definition.  Functions are  searched
       with a pattern, typedefs with a line number.  Specifiers are given in separate fields on the line, separated by blanks or tabs.

       Using the tags file, can quickly find these objects definitions.

       If  the	-x  flag  is  given,  writes  to standard output a list containing each object name, its line number, the file name in which it is
       defined, and the text of the line.  This list is a simple index which can be printed out as an off-line readable function index.

Options
       -a		   Appends information to an existing tags file.

       -B		   Uses backward search patterns (?...?).

       -F		   Uses forward search patterns (/.../) (default).

       -t		   Creates typedef tags.

       -u		   Updates the specified tags file.  All references to tags are deleted, and the new values  are  appended  to	the  file.
			   Note  that  this  option is implemented in a way which is rather slow.  It is usually faster to simply rebuild the tags
			   file.)

			   The tag main is treated specially in C programs.  The tag formed is created by prepending M to the name  of	the  file,
			   with  a  trailing  .c  removed,  if	any, and leading pathname components also removed.  This makes use of practical in
			   directories with more than one program.

       -v		   Generates an index listing function name, file name, and pages number.  Since the output will be  sorted  into  lexico-
			   graphic order, it may be desired to run the output through sort -f.	For example,
			   ctags -v files | sort -f > index
			   Files  whose  name  ends  in .c or .h are assumed to be C source files and are searched for C routine and macro defini-
			   tions.  Others are first examined to see if they contain any Pascal or Fortran routine definitions; if  not,  they  are
			   processed again looking for C definitions.

       -w		   Suppresses warning diagnostics and generates a listing file.  This list contains each object name, its line number, the
			   file name in which it is defined, and the text of the line, and is identical to the list produced when no  options  are
			   given.

       -x		   Writes  to  standard  output a list containing each object name, its line number, the file name in whcih it is defined,
			   and the text of the line.

Restrictions
       Recognition of functions, subroutines and procedures for FORTRAN and Pascal do not deal with block structure.  Therefore  you  cannot  have
       two Pascal procedures in different blocks with the same name.

       Does not know about #ifdefs.

       Does  not know about Pascal types.  Relies on the input being well formed to detect typedefs.  Use of -tx shows only the last line of type-
       defs.

Files
       tags	 output tags file

See Also
       ex(1), vi(1)

																	  ctags(1)
All times are GMT -4. The time now is 02:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy