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
MPI_Type_hvector(3OpenMPI)												MPI_Type_hvector(3OpenMPI)

NAME
MPI_Type_hvector - Creates a vector (strided) datatype with offset in bytes -- use of this routine is deprecated. SYNTAX
C Syntax #include <mpi.h> int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype) Fortran Syntax INCLUDE 'mpif.h' MPI_TYPE_HVECTOR(COUNT, BLOCKLENGTH, STRIDE, OLDTYPE, NEWTYPE, IERROR) INTEGER COUNT, BLOCKLENGTH, STRIDE, OLDTYPE INTEGER NEWTYPE, IERROR INPUT PARAMETERS
count Number of blocks (nonnegative integer). blocklength Number of elements in each block (nonnegative integer). stride Number of bytes between start of each block (integer). oldtype Old datatype (handle). OUTPUT PARAMETERS
newtype New datatype (handle). IERROR Fortran only: Error status (integer). DESCRIPTION
Note that use of this routine is deprecated as of MPI-2. Use MPI_Type_create_hvector instead. This deprecated routine is not available in C++. The function MPI_Type_hvector is identical to MPI_Type_vector, except that stride is given in bytes, rather than in elements. The use for both types of vector constructors is illustrated in the examples in Section 3.12.7 of the MPI-1 Standard. Assume that oldtype has type map {(type(0), disp(0)), ..., (type(n-1), disp(n-1))} with extent ex. Let bl be the blocklength. The newly created datatype has a type map with count * bl * n entries: {(type(0), disp(0)), ..., (type(n-1), disp(n-1)), (type(0), disp(0) + ex), ..., (type(n-1), disp(n-1) + ex), ..., (type(0), disp(0) + (bl -1) * ex),...,(type(n-1), disp(n-1) + (bl -1) * ex), (type(0), disp(0) + stride), ...,(type(n-1), disp(n-1) + stride), ..., (type(0), disp(0) + stride + (bl - 1) * ex), ..., (type(n-1), disp(n-1) + stride + (bl -1) * ex), ..., (type(0), disp(0) + stride * (count -1)), ...,(type(n-1), disp(n-1) + stride * (count -1)), ..., (type(0), disp(0) + stride * (count -1) + (bl -1) * ex), ..., (type(n-1), disp(n-1) + stride * (count -1) + (bl -1) * ex)} ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func- tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. SEE ALSO
MPI_Type_create_hvector MPI_Type_vector Open MPI 1.2 September 2006 MPI_Type_hvector(3OpenMPI)
All times are GMT -4. The time now is 12:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy