Sponsored Content
Top Forums Shell Programming and Scripting Use to awk to match pattern, and print the pattern Post 302355687 by grossgermany on Wednesday 23rd of September 2009 11:42:49 AM
Old 09-23-2009
Hi Dan,

Thanks a lot for your reply. But the code won't work in instances such as this:
input:
Code:
usa,66 canada99292,japan222,44 france59664,egypt223

because within each column, the field separator actually changes to space

Is it possible to have multiple field separator in place simultaneously, in this case: space and comma. If this is possible, then your code would work .

Last edited by vgersh99; 09-23-2009 at 12:46 PM.. Reason: code tags, PLEASE!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK, print no of records after pattern match.

Hi ALL :). i have a file, cat 3 + dog 5 + rat 6 - i want to print no of record having pattern "+". thanks in advance :confused:. (2 Replies)
Discussion started by: admax
2 Replies

2. Shell Programming and Scripting

Need one liner to search pattern and print everything expect 6 lines from where pattern match made

i need to search for a pattern from a big file and print everything expect the next 6 lines from where the pattern match was made. (8 Replies)
Discussion started by: chidori
8 Replies

3. Shell Programming and Scripting

Print strings that match pattern with awk

I have a file with many lines which contain strings like .. etc. But with no rule regarding field separators or anything else. I want to print ONLY THE STRING from each line , not the entire line !!! For example from the lines : Flow on service executed with success in . Performances... (5 Replies)
Discussion started by: black_fender
5 Replies

4. Shell Programming and Scripting

awk Help: Horizontal to Vertical print with pattern match

Hi AWK Experts, Following is the data : BRH113 DD AA HH CA DD DD AA HH BRH091 A4 A6 AH H7 67 HH J8 9J BRH0991 AA D8 C23 V5 H7 BR2 BRH991 AA HH GG5 BT0 JJ0 I want the output to be alligned with the pattern matching "BRH" inthe line. The output should be look like: A]... (4 Replies)
Discussion started by: rveri
4 Replies

5. Shell Programming and Scripting

Script to match a pattern and print only the pattern and after that

Hi, I am writing a shell script to parse some files, and gather data. The data in the files is displayed as below. .......xyz: abz: ...... .......xyz: abz: ..... I have tried using awk and cut, bu the position of these values keep changing, so I can use awk and split it into columns. ... (14 Replies)
Discussion started by: Serena
14 Replies

6. Shell Programming and Scripting

awk print pattern match line and following lines

Data: Pattern Data Data Data Data Data Data Data Data Data ... With awk, how do I print the pattern matching line, then the subsequent lines following the pattern matching line. Varying number of lines following the pattern matching line. (9 Replies)
Discussion started by: dmesserly
9 Replies

7. UNIX for Dummies Questions & Answers

Match Pattern after certain pattern and Print words next to Pattern

Hi experts , im new to Unix,AWK ,and im just not able to get this right. I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
Discussion started by: 100bees
2 Replies

8. Shell Programming and Scripting

Print only next pattern in a line after a pattern match

I have 2013-06-11 23:55:14 1Umexd-0004cm-IG <= user@domain.com I need sed/awk operation on this, so that it should print the very next pattern only after the the pattern mach <= ie only print user@domain.com (7 Replies)
Discussion started by: anil510
7 Replies

9. Shell Programming and Scripting

Match pattern and print the line number of occurence using awk

Hi, I have a simple problem but i guess stupid enough to figure it out. i have thousands rows of data. and i need to find match patterns of two columns and print the number of rows. for example: inputfile abd abp 123 abc abc 325 ndc ndc 451 mjk lkj... (3 Replies)
Discussion started by: redse171
3 Replies

10. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies
XmStringSegmentCreate(library call)									       XmStringSegmentCreate(library call)

NAME
XmStringSegmentCreate -- A compound string function that creates a compound string SYNOPSIS
#include <Xm/Xm.h> XmString XmStringSegmentCreate( char * text, XmStringTag tag, XmStringDirection direction, Boolean separator); DESCRIPTION
This function is obsolete and exists for compatibility with previous releases. It can be replaced by using a combination of XmStringCompo- nentCreate and XmStringConcat. XmStringSegmentCreate is a high-level function that assembles a compound string consisting of a font list element tag, a direction component, a text component, and an optional separator component. The function allocates space for the returned compound string. The application is responsible for managing the allocated space. The application can recover the allocated space by calling XmStringFree. text Specifies a NULL-terminated string to be used as the text component of the compound string. tag Specifies the tag component to be associated with the text. The value XmFONTLIST_DEFAULT_TAG is for compatibility with previous releases. direction Specifies the direction of the text. separator A value of False means the compound string does not have a separator at the end. A value of True, means a separator immediately follows the text component. RETURN
Returns a new compound string. RELATED
XmStringCreate(3). XmStringSegmentCreate(library call)
All times are GMT -4. The time now is 08:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy