I am trying to use regular expression to identify ONLY the commands that hasn't the word "tablespace" within it. a command starts with "create table" and ends with ; (semicolon)
example file:
create table first tablespace ;
create table second
(
BBL_CUSTOMER_NAME VARCHAR2(32),
a... (7 Replies)
Hi i am trying to replace blank lines with a number 0. I tried the following code
awk '{print NF ? $0: blankrow}' blankrow = "0" file1.prg>file2.prg
however i get the following error: fatal: cannot open file `blankrow' for reading (No such file or directory)
file example:
1
2
3
5
6... (11 Replies)
Hi,
I need a regular expression grepping all lines starting with '*' followed by a VARIOUS number of blanks and then followed by the string 'Runjob=1'.
I tried that code, but it doesn't work:
grep -i '*'+'Runjob=1' INPUT_FILE >>OUTPUT_FILE
Can someone help me?
Thanks (8 Replies)
Hey, I found a way to print the lines which is just before a regular expression, not including the expression.
sed -n '/regexp/{n;p;}' myfile
Now I'm looking for a way to print all lines, exept the regular expression and also the line before the same regular expression.
Use code tags. (1 Reply)
I would like to print 3 lines after a regular expression is found in the logfile. I'm using the following code:
grep -n "$reg_exp" file.txt |while read LINE ;do i=$(echo $LINE |cut -d':' -f1 ) ;sed -n "$i,$(($i+3))p" file.txt ;done
The above code things works fine,but sometimes gives erroneous... (3 Replies)
Hi.. I'm facing a trouble in replacing two blank lines in a file using shell script...
I used sed to search a line and insert two blank lines after the searchd line using the following sed command.
Sed "/data/{G;G;}/" filename. In the file, after data tag, two lines got inserted blank lines.. Now... (1 Reply)
Hi.. I'm facing a trouble in replacing two blank lines in a file using shell script...
I used sed to search a line and insert two blank lines after the searchd line using the following sed command.
sed "/data/{G;G;}/" filename . In the file, after data tag, two lines got inserted blank lines..... (4 Replies)
I have a very large file (over 700 million lines) that has some lines that I need to delete. An example of 5 lines of the file:
HS4_80:8:2303:19153:193032 153 k80:138891
HS4_80:8:2105:5544:43174 89 k88:81949
165 k88:81949 323 0 * = 323 0 ... (6 Replies)
Using a regular expression, I would like multiple lines to be matched.
By default, a period (.) matches any character except newline. However, (?s) and /s modifiers are supposed to force . to accept a newline and to match any character including a newline.
However, the following two perl... (4 Replies)
Discussion started by: LessNux
4 Replies
LEARN ABOUT DEBIAN
stag-diff
STAG-DIFF(1p) User Contributed Perl Documentation STAG-DIFF(1p)NAME
stag-diff - finds the difference between two stag files
SYNOPSIS
stag-diff -ignore foo-id -ignore bar-id file1.xml file2.xml
DESCRIPTION
Compares two data trees and reports whether they match. If they do not match, the mismatch is reported.
ARGUMENTS
-help|h
shows this document
-ignore|i ELEMENT
these nodes are ignored for the purposes of comparison. Note that attributes are treated as elements, prefixed by the containing
element id. For example, if you have
<foo ID="wibble">
And you wish to ignore the ID attribute, then you would use the switch
-ignore foo-ID
You can specify multiple elements to ignore like this
-i foo -i bar -i baz
You can also specify paths
-i foo/bar/bar-id
-parser|p FORMAT
which parser to use. The default is XML. This can also be autodetected by the file suffix. Other alternatives are sxpr and itext. See
Data::Stag for details.
-report|r ELEMENT
report mismatches as they occur on each element of type ELEMENT
multiple elements can be specified
-verbose|v
used in conjunction with the -report switch
shows the tree of the mismatching element
OUTPUT
If a mismatch is reported, a report is generated displaying the subpart of the tree that could not be matched. This will look like this:
REASON: no_matching_node: annotation
no_matching_node: feature_set
no_matching_node: feature_span
no_matching_node: evidence
no_matching_node: evidence-id
data_mismatch(:15077290 ne :15077291): evidence-id AND evidence-id
Due to the nature of tree matching, it can be difficult to specify exactly how trees do not match. To investigate this, you may need to use
the -r and -v options. For the above output, I would recommend using
stag-diff -r feature_span -v
ALGORITHM
Both trees are recursively traversed... see the actual code for how this works
The order of elements is not important; eg
<foo>
<bar>
<baz>1</baz>
</bar>
<bar>
<baz>2</baz>
</bar>
</foo>
matches
<foo>
<bar>
<baz>2</baz>
</bar>
<bar>
<baz>1</baz>
</bar>
</foo>
The recursive nature of this algorithm means that certain tree comparisons will explode wrt time and memory. I think this will only happen
with very deep trees where nodes high up in the tree can only be differentiated by nodes low down in the tree.
Both trees are loaded into memory to begin with, so it may thrash with very large documents
AUTHOR
Chris Mungall cjm at fruitfly dot org
SEE ALSO
Data::Stag
perl v5.10.0 2008-12-23 STAG-DIFF(1p)