Sponsored Content
Top Forums Shell Programming and Scripting awk or sed command to print specific string between word and blank space Post 302477733 by dhiren1 on Monday 6th of December 2010 09:37:48 AM
Old 12-06-2010
Try This :

Quote:
sed 's/\(.*\)\(disp.*\)\( .*\)/\2/g' file.txt | awk '{print $1}'
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search a word and print specific string using awk

Hi, I have list of directory paths in a variable and i want to delete those dirs and if dir does not exist then search that string and get the correct path from xml file after that delete the correct directory. i tried to use grep and it prints the entire line from the search.once i get the entire... (7 Replies)
Discussion started by: dragon.1431
7 Replies

2. Shell Programming and Scripting

search-word-print-specific-string

Hi, Our input xml looks like: <doc> <str name="account_id">1111</str> <str name="prd_id">DHEP155EK</str> </doc> - <doc> <str name="account_id">6666</str> <str name="prd_id">394531662</str> </doc> - <doc> <str name="account_id">6666</str> <str... (1 Reply)
Discussion started by: Jassz
1 Replies

3. Shell Programming and Scripting

Need awk help to print specific columns with as string in a header

awk experts, I have a big file of 4000 columns with header. Would like to print the columns with string value of "Commands" in header. File has "," separator. This file is on ESX host with Bash. Thanks, Arv (21 Replies)
Discussion started by: arv_cds
21 Replies

4. Shell Programming and Scripting

sed or awk to print 2nd last word

Hi, I have a file which has the following /usr/new/xyz/abc /us1/neb/yxr/def /usr/bin/cloud1/fgh /net/bin1/txt1/kdq I want to do something like this /usr/new/xyz/abc xyz /us1/neb/yxr/def yxr /usr/bin/cloud1/fgh cloud1 /net/bin1/txt1/kdq txt1 I need to add the 2nd last word to the... (3 Replies)
Discussion started by: matbrow
3 Replies

5. Shell Programming and Scripting

break the string and print it in a new line after a specific word

Hi Gurus I am new to this forum.. I am using HP Unix OS. I have one single string in input file as shown below Abc123 | cde | fgh | ghik| lmno | Abc456 |one |two |three | four | Abc789 | five | Six | seven | eight | Abc098 | ........ I want to achive the result in a output file as shown... (3 Replies)
Discussion started by: kannansr621
3 Replies

6. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

7. Shell Programming and Scripting

awk until blank space and print next line

Hello and Happy New Year 2012! I have this example: 1,2,3 4,5,6 7,8,9 For that, I'm trying to get: 1,2,3 4,5,6 7,8,9 for that, I think this might work but doesnt work so far: awk '{for(i=1;i=NF;i++);sub(/\//,"",$i);print $i}' myfile (2 Replies)
Discussion started by: Gery
2 Replies

8. Shell Programming and Scripting

sed / awk to get specific word in line

I have http log that I want to get words after specific "tag", this a sample line from the log: 98,POST,200 OK,www.facebook.com,Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,/ajax/updatestatus.php?__a=1,datr=P_H1TgjTczCHxiGwdIF5tvpC; lu=Si1fMkcrU2SInpY8tk_7tAnw;... (6 Replies)
Discussion started by: erlanq
6 Replies

9. UNIX for Dummies Questions & Answers

Adding word in blank space

Hi, var=QSB SBD SDN SGJ SJP SKB SKD SLP SML SNB SRE SRG STP TAJ UMP UNO VKS VND VNS WAH ZRR I have to put *.sql after every word What I did echo $var>/root/file1.sql sed -i 's/ /*.sql /g' file1.sql cat file1.sql Output QSB*.sql SBD*.sql SDN*.sql SGJ*.sql SJP*.sql SKB*.sql... (9 Replies)
Discussion started by: kaushik02018
9 Replies

10. Shell Programming and Scripting

awk to print string if tag is specific value

In the below awk I am trying to print expName only if another tag planExecuted is true. In addition to the expName I am also printing planShortID. For some reason the word experiment gets printed so I remove it with sed. I have attached the complete index.html as well as included a sample of it... (1 Reply)
Discussion started by: cmccabe
1 Replies
mlib_SignalAutoCorrel_S16(3MLIB)			    mediaLib Library Functions				  mlib_SignalAutoCorrel_S16(3MLIB)

NAME
mlib_SignalAutoCorrel_S16, mlib_SignalAutoCorrel_S16S, mlib_SignalAutoCorrel_F32, mlib_SignalAutoCorrel_F32S - signal auto-correlation SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_SignalAutoCorrel_S16(mlib_d64 *correl, const mlib_s16 *src, mlib_s32 disp, mlib_s32 n); mlib_status mlib_SignalAutoCorrel_S16S(mlib_d64 *correl, const mlib_s16 *src, mlib_s32 disp, mlib_s32 n); mlib_status mlib_SignalAutoCorrel_F32(mlib_d64 *correl, const mlib_f32 *src, mlib_s32 disp, mlib_s32 n); mlib_status mlib_SignalAutoCorrel_F32S(mlib_d64 *correl, const mlib_f32 *src, mlib_s32 disp, mlib_s32 n); DESCRIPTION
Each of these functions performs auto-correlation. For monaural signals, the following equation is used: 1 n-d-1 correl[0] = ----- * SUM (src[i] * src[i + d]) n - d i=0 For stereo signals, the following equation is used: 1 n-d-1 correl[0] = ----- * SUM (src[2*i] * src[2*(i + d)]) n - d i=0 1 n-d-1 correl[1] = ----- * SUM (src[2*i + 1] * src[2*(i + d) + 1]) n - d i=0 where d = disp. PARAMETERS
Each of the functions takes the following arguments: correl Pointer to the auto-correlation array. In the stereo version, correl[0] contains the auto-correlation of channel 0, and correl[1] contains the auto-correlation of channel 1. src Source signal array. disp Displacement. 0 <= disp < n. n Number of samples in the source signal array. RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_SignalCrossCorrel_S16(3MLIB), attributes(5) SunOS 5.11 2 Mar 2007 mlib_SignalAutoCorrel_S16(3MLIB)
All times are GMT -4. The time now is 04:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy