Sponsored Content
Top Forums Shell Programming and Scripting Need to print the next word from the same line based on grep string condtion match. Post 302932823 by disedorgue on Sunday 25th of January 2015 05:36:53 AM
Old 01-25-2015
Quote:
Originally Posted by siva83
Thanks for the update.

I have executed the command which provided and it's displaying only one character after matching the string which passed on grep command.

Code:
rep -Po '(?<=File copied completed:)\W*\K[^ ]' sample.log

sample.log have the data
Code:
 Java.lanag.xyz......File copied completed:Report1 

Out put is coming
Code:
R

and it should be
Code:
Report1

You forgot the '*' final:
my syntax:
Code:
grep -Po '(?<=File copied completed:)\W*\K[^ ]*'

This User Gave Thanks to disedorgue For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print a line containing word in a column using grep

hi, how to print a row which contains a perticular word in its third column using grep, cut, or any thing else. thanks (2 Replies)
Discussion started by: useless79
2 Replies

2. Shell Programming and Scripting

Search word in a line and print earlier pattern match

Hi All, I have almost 1000+ files and I want to search specific pattern. Looking forwarded your input. Search for: word1.word2 (Which procedure contain this word, I need procedure name in output. Expected output: procedure test1 procedure test2 procedure test3 procedure test4 ... (7 Replies)
Discussion started by: susau_79
7 Replies

3. Shell Programming and Scripting

grep N lines after match and then print them on 1 line each

Hello I need some help with this job. file.txt ----- cut ---- TARGET 13/11/08 20:43:21 POINT 1 MOVE 8 772102y64312417771 TARGET 13/11/08 21:10:01 POINT 2 MOVE 5 731623jjd12njhd ----- cut ---- this is the example. i need to grep for the word TARGET and print next 4 lines like... (1 Reply)
Discussion started by: alekkz
1 Replies

4. UNIX for Dummies Questions & Answers

grep N lines after match and then print them on 1 line each

Hello I have a silly question. I need to grep a match in text file and then print 5 lines after it. grep -A 5 .... do it. OK The next thing I can not handle is I need each output to be on 1 line match line2 line3 line4 line5 match line2 line3 line4 line5 etc.. I will really... (10 Replies)
Discussion started by: alekkz
10 Replies

5. Shell Programming and Scripting

awk to print lines based on string match on another line and condition

Hi folks, I have a text file that I need to parse, and I cant figure it out. The source is a report breaking down softwares from various companies with some basic info about them (see source snippet below). Ultimately what I want is an excel sheet with only Adobe and Microsoft software name and... (5 Replies)
Discussion started by: rowie718
5 Replies

6. Shell Programming and Scripting

Command to grep a word and print the whole line splitted into many

Hi, I need to search a word in the java file. Assume the line in the java file is, (the line was splitted into 3 lines) 1.operationContext.sendFeedback(2.FeedbackType.ERROR, null, "Input is empty.", "Input Details: pr 3.ovide Valid pair(s): "+pairType); When i grep for the word... (6 Replies)
Discussion started by: tulasiram
6 Replies

7. Shell Programming and Scripting

Print string after the word match

Hi, I have the logs : cat logsx.txt 744906,{"reportingGroups":,"version":"2.0"} 678874,{"reportingGroups":,"version":"2.0"} 193571,{"reportingGroups":,"version":"2.0"} 811537,{"reportingGroups":,"version":"2.0"} 772024,{"reportingGroups":,"version":"2.0"}... (5 Replies)
Discussion started by: justbow
5 Replies

8. Shell Programming and Scripting

How to match the first word and print only that line in UNIX?

Below is the file DISK-A 109063.2 49 31 40.79 DISK-B 110058.5 49 44 57.07 DISK-c 4402.4 2 1 2.14 from the file, i want to search for 'DISK-A' and print only that line with the first word matching to DISK-A and the output should skip DISK-A. Desired Output: (If i'm... (2 Replies)
Discussion started by: web2moha
2 Replies

9. Shell Programming and Scripting

Grep command to search a regular expression in a line an only print the string after the match

Hello, one step in a shell script i am writing, involves Grep command to search a regular expression in a line an only print the string after the match an example line is below /logs/GRAS/LGT/applogs/lgt-2016-08-24/2016-08-24.8.log.zip:2016-08-24 19:12:48,602 ERROR... (9 Replies)
Discussion started by: Ramneekgupta91
9 Replies

10. Shell Programming and Scripting

Match string from two files and print line

Hi, I have been trying to find help with my issue and I'm thinking awk may be able to do it. I have two files eg file1.txt STRING1 230 400 0.36 STRING2 400 230 -0.13 STRING3 130 349 1 file2.txt CUFFFLINKS 1 1394 93932 . + STRING1 CUFFFLINKS ... (9 Replies)
Discussion started by: zward
9 Replies
MAUTIL(1)							   User Commands							 MAUTIL(1)

NAME
mautil - Mono.Addins Setup Utility SYNOPSIS
mautil [options] <command> [arguments] DESCRIPTION
The mautil tool works with Mono.Addins repositories and packages. OPTIONS
--registry, -reg Specify add-in registry path --path, -p Specify startup path -v Verbose output Add-in commands: install, i Installs add-ins. uninstall, u Uninstalls add-ins. check-install, ci Checks installed add-ins. update, up Updates installed add-ins. list, l Lists installed add-ins. list-av, la Lists add-ins available in registered repositories. list-update, lu Lists available add-in updates. Repository Commands: rep-add, ra Registers repositories. rep-remove, rr Unregisters repositories. rep-update, ru Updates the lists of available addins. rep-list, rl Lists registered repositories. Add-in Registry Commands: reg-update, rgu Updates the add-in registry. reg-build, rgb Rebuilds the add-in registry. info Prints information about an add-in. Packaging Commands: rep-build, rb Creates a repository index file for a directory structure. pack, p Creates a package from an add-in configuration file. help, h Shows help about a command. Debug Commands: dump-file Prints the contents of a registry file. SEE ALSO
mono(1). Mono.Addins May 2008 MAUTIL(1)
All times are GMT -4. The time now is 06:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy