Match from one pattern to second occurrence of second pattern
Given an XML file that contains (NOT "consists of"):
I want to isolate and operate on the lines between <key>system.burn</key> and the second occurrence of <dict>, so:
Now, sed -n '/<key>system.burn<\/key>/,/<dict>/2 p' /etc/authorization would get me what I want... except I'm on a Mac, and so do not have GNU see. That gets me "invalid command code 2" I can delete the 2 and wind up with a valid pattern, but it only returns:
I don't want to just return the six lines after <key>system.burn</key> as I cannot be positive that there will always just be six lines.
I have a feeling awk is going to be the answer here, but I've got a long curve to climb with awk. I'm proud of myself for being able to print $2 or even $NF, so that tells you how advanced I am there :-P
I need to count the number of occurrences of a pattern, say 'key', between each occurrence of a different pattern, say 'lu'.
Here's a portion of the text I'm trying to parse:
lu S1234L_149_m1_vg.6, part-att 1, vdp-att 1 p-reserver IID 0xdb
registrations:
key 4156 4353 0000 0000
... (3 Replies)
Hi, I have 2 files that I have modified to basically match each other, however I want to determine what (if any) line in file 1 does not exist in file 2. I need to match column $1 and $2 as a single string in file1 to $1 and $2 in file2 as these two columns create a match.
I'm stuck in an AWK... (9 Replies)
Hello Guyz
I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline
ABC
DEF
LMN
EFG
HIJ
LMN
OPQ
In the above text i need to... (8 Replies)
Hi,
I am getting crazy after days on looking at it:
Bash in Ubuntu 12.04.1
I want to do this:
pattern="system /path1/file1 file1"
new_pattern=" data /path2/file2 file2"
file to edit: data.db
- I need to search in the file data.db for the nth occurrence of pattern
- pattern must... (14 Replies)
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)
Ive used this snippet of code on a solaris box thousands of times.
But it isnt working on the new linux box
sed -n '/interface LoopBack0/{N;/ ip address /p;}' *.conf
its driving me nuts !!
Is there something Im missing ? (7 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
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)
AWK command to get file content until 3 occurrence of pattern match,
INPUT FILE:
JMS_BODY_FIELD:JMSText = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<custOptIn xmlns="http://com/walm/ta/cu/ccs/xml2">
<person>Romi</person>
<appName>SAP</appName>
</custOptIn>
... (4 Replies)
Discussion started by: prince1987
4 Replies
LEARN ABOUT SUSE
brasero
BRASERO(1) General Commands Manual BRASERO(1)NAME
brasero - Simple and easy to use CD/DVD burning application for the Gnome Desktop
SYNOPSIS
brasero [options] [uri] [uri] ...
DESCRIPTION
This manual page documents briefly the brasero command.
rasero is a disc burning application. It is designed to be simple and easy to use. It allows to create data CD/DVD, audio CD, to copy
CD/DVD and to burn images. It has some nices features, such as a song, image and video previewer. It can also search for files (thanks to
beagle) and display a playlist and its contents.
OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included
below. For a complete description, see the Info files.
-p, --project=PROJECT
Open the specified project.
-a, --audio
Open an empty audio project.
-d, --data
Open an empty data project.
-c, --copy=PATH
Copy a disc.
-j, --cover=PATH
Cover to use.
-o, --video
Open a video project adding the URIs given on the command line.
-i, --image=PATH
Uri of an image file or a cue file to be burnt (autodetected).
-e, --empty
Force brasero to display the project selection page.
-b, --blank
Open the blank disc dialog.
-k, --check
Open the check disc dialog.
-n, --ncb
Open a data project with the contents of burn:/// URI.
-r, --burn-and-remove-project=PATH
Burn the specified project and REMOVE it.
-g, --debug
Display debug statements on stdout.
--display=DISPLAY
X display to use.
-?, --help
Show summary of options.
-v, --version
Show version of program.
AUTHOR
Brasero manual page was written by Philippe Rouquier <philippero@libertysurf.fr> and Luis Medinas <lmedinas@gmail.com>.
GNOME January 11, 2009 BRASERO(1)