Sponsored Content
Top Forums Shell Programming and Scripting Print characters till the next space when the pattern is found Post 302565884 by gpk_newbie on Wednesday 19th of October 2011 04:15:37 AM
Old 10-19-2011
Print characters till the next space when the pattern is found

i have a file which contains alphanumeric data in every line. what i need is the data after certain pattern. the data after the pattern is not of fixed length so i need the data till the space after the pattern.

Input file:
bfdkasfbdfg khffkf lkdhfhdf pattern (datarequired data not required)
jdbfmdsfb kjsdfhfsd dfh pattern (sample jfbjdjf)

desired output file :
datarequired
sample
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print lines till till a pattern is matched in loop

Dear All I have a file like this 112534554 446538656 444695656 225696966 226569744 228787874 113536566 443533535 222564552 115464656 225445345 225533234 I want to cut the file into different parts where the first two columns are '11' . The first two columns will be either... (3 Replies)
Discussion started by: anoopvraj
3 Replies

2. Shell Programming and Scripting

way to print all the string till we get a space and a number

Is there any way to print all the string till we get a space and a number and store it a variable for eg we have string java.io.IOException: An existing connection was forcibly closed by the remote host 12 All I want is to store "java.io.IOException: An existing connection was forcibly closed... (13 Replies)
Discussion started by: villain41
13 Replies

3. Shell Programming and Scripting

Need to remove few characters from each line till a pattern is matched

Hi All, I want to remove first few characthers from starting of the line till ',' Comma... which needs to be done for all the lines in the file Eg: File content 1,"1234",emp1,1234 2,"2345",emp2,2345 Expected output is ,"1234",emp1,1234 ,"2345",emp2,2345 How can parse... (4 Replies)
Discussion started by: kiranlalka
4 Replies

4. Shell Programming and Scripting

print next word after found pattern

Hi all, I'd like to print the next word after a found pattern. example text: word1 word2 word3 word4 pattern word5 pattern word1 word2 word3 word4 word1 word2 pattern word4 basiclly the word after pattern. Thanks (9 Replies)
Discussion started by: stinkefisch
9 Replies

5. Shell Programming and Scripting

awk to print all lines after a pattern is found

Is there a way with aw to print all lines after a string is found There is a file like this ....... ........ 2012/19/11 :11.58 PM some data lne no date 2012/19/11 :11.59 PM some other data 2012/20/11 :12.00 AM some other data some line without dates some more lines without dates... (8 Replies)
Discussion started by: swayam123
8 Replies

6. Shell Programming and Scripting

Copy/print all lines between pattern is found in .log files

Hi, I have a folder with multiple (< 33) .log files. And I have to copy the lines between two patterns from all the .log files to a new file. (script file with a loop?) Thanks in advance. 1.log ... .. xx1> begin ... .. .. >>> Total: 2 Alarms .. .. (17 Replies)
Discussion started by: AK47
17 Replies

7. Shell Programming and Scripting

Displaying text till pattern match found in a line

Hi All, From the below line if we want to display all the text till found pattern dot/. I was trying with the below code but couldn't able to print text before the pattern. it display texts which is found after pattern. awk '/assed/{print;getline;print}' file_name | sed 's/^*. *//' input... (4 Replies)
Discussion started by: Optimus81
4 Replies

8. Shell Programming and Scripting

Print pattern regardless of space between

I have this content in file sshd : ALL : allow SSHD : all : ALLOW sshD : All : AllOW What I need is to print the occurrence of "sshd:all" regardless of the spaces between them and if lower/upper case. So all lines should be printed in output when "grepped" or "printed... (3 Replies)
Discussion started by: anil510
3 Replies

9. Shell Programming and Scripting

Print character after pattern found

Hi Gurus, i need your help to create a script the will print a characters after the pattern was found. Sample lines are below: My birthday:"1977-16-07", My birthday:"1975-16-07" My birthday:"1970-16-07". My patter should be "birthday:", then i want to print the following characters which... (18 Replies)
Discussion started by: scripter123
18 Replies

10. Shell Programming and Scripting

UNIX help to print 50 lines after every 3rd occurrence pattern till end of file

I need help with extract/print lines till stop pattern. This needs to happen after every 3rd occurrence of start pattern and continue till end of file. Consider below is an example of the log file. my start pattern will be every 3rd occurrence of ERROR_FILE_NOT_FOUND and stop pattern will be... (5 Replies)
Discussion started by: NSS
5 Replies
TFBS::PatternGen(3pm)					User Contributed Perl Documentation				     TFBS::PatternGen(3pm)

NAME
TFBS::PatternGen - a base class for pattern generators DESCRIPTION
TFBS::PatternGen is a base classs providing methods common to all pattern generating modules. It is meant to be inherited by a concrete pattern generator, which must have its own constructor. pattern Title : pattern Usage : my $pattern_obj = $patterngen->pattern() Function: retrieves a pattern object produced by the pattern generator Returns : a pattern object (currently available pattern generators return a TFBS::Matrix::PFM object) Args : none Warning : If a pattern generator produces more than one pattern, this method call returns only the first one and prints a warning on STDERR, In those cases you should use I<all_patterns> or I<patternSet> methods. patternSet Title : patternSet Usage : my $patternSet = $patterngen->patternSet() Function: retrieves a pattern set object containing all the patterns produced by the pattern generator Returns : a pattern set object (currently available pattern generators return a TFBS::MatrixSet object) Args : none all_patterns Title : all_patterns Usage : my @patterns = $patterngen->all_patterns() Function: retrieves an array of pattern objects produced by the pattern generator Returns : an array of pattern set objects (currently available pattern generators return an array of TFBS::Matrix::PFM objects) Args : none perl v5.14.2 2008-01-24 TFBS::PatternGen(3pm)
All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy