I promised to get back with results.
The danmero solution is working charmingly, although I'm not fully understand how it read previous line and compare with current one. The data from my file are several lines long and script pointed me exactly where to look for differences. Thanks again danmero, this is exactly what I need.
Although is not exactly what I intended to obtain, I tested the rbatte1 solution and after choosing h or S option I get an error:
Probably becouse i use bash which i must be mentioned earlyer. Sorry.
Thanks again for your time. My problem was solved
Hello Friends,
I want to write a script for the following:
nlscux62:tibprod> grep "2008 Apr 30 01:" SA_EHV_SPEED_SFC_IN_03-SA_EHV_SPEED_SFC_IN_03-2.log | grep -i post | more
2008 Apr 30 01:01:23:928 GMT +2 SAPAdapter.SA_EHV_SPEED_SFC_IN_03-SA_EHV_SPEED_SFC_IN_03-2 Info AER3-000095 IDOC... (2 Replies)
Hi guru's,
Am new to shell scripting.
I am getting the below o/p from the oracle database, when I fire a query.
ID JOB_ID ELAPSED_TIME FROM TO
----- ------ ------------------- -------- --------
62663 11773 01/06/2009 09:49:13 SA CM
62664 11773 ... (4 Replies)
Hi,
I have a file with one column data (sample below) and I am trying to write a shell script to calculate the difference between consecutive data valuse i.e
Var = Ni -N(i-1)
0.3141
-3.6595
0.9171
5.2001
3.5331
3.7022
-6.1087
-5.1039
-9.8144
1.6516
-2.725
3.982
7.769
8.88 (5 Replies)
Hi guys
I am deleting a unique line from the file and also need to remove the line above it which is NOT unique and servers as a record separator. Here is an example:
#
101 803E 823F 8240
#
102 755f 4F2A 4F2B
#
290 747D 0926 0927
#
999 8123 813E ... (5 Replies)
I have a file wich contains time formats and i need to get the time difference
TIME1 TIME2
==================================
20120624192555.6Z 20120624204006.5Z
which means first date 2012/6/24 19:25:55,second date 2012/6/24 20:40:06 so when i get the time... (1 Reply)
I have a file wich contains time formats and i need to get the time difference
TIME1 TIME2
=============== ===================
20120624192555.6Z 20120624204006.5Z
which means first date 2012/6/24 19:25:55,second date 2012/6/24 20:40:06 so when i get the time... (23 Replies)
Hi All :o,
I have some log files which contains these informations:
2013-04-24 09:11:34.018 INFO XXXXXXXXXXXX
2013-04-24 09:11:34.029 INFO YYYYYYYYYYYY
2013-04-24 09:11:34.039 INFO ZZZZZZZZZZZZZZZ
2013-04-24 09:12:21.295 INFO TTTTTTTTTTTTTTT
2013-04-24 09:12:21.489 INFO... (3 Replies)
I was looking at this script which outputs the two lines which differs less than one sec.
#!/usr/bin/perl -w
use strict;
use warnings;
use Time::Local;
use constant SEC_MILIC => 1000;
my $file='infile';
## Open for reading argument file.
open my $fh, "<", $file or die "Cannot... (1 Reply)
I have a text file with many thousands of lines, a small sample of which looks like this:
InputFile:PS002,003 D -1 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 6 -1 -1 -1 -1 0 509 0
PS002,003 PSQ 0 1 7 18 1 0 -1 1 1 3 -1 -1 ... (5 Replies)
Discussion started by: jvoot
5 Replies
LEARN ABOUT CENTOS
sgmldiff
SGMLDIFF(1)SGMLDIFF(1)NAME
sgmldiff - Find differences in the markup of two SGML files
SYNOPSIS
sgmldiff [ options ... ] file1 file2 [ -a | --attributes
| -c [ attributes | nesting | textpos ] | --context [ attributes | nesting | textpos ]
| -s | --statistics
| -h | --help
| -v | --version ]
DESCRIPTION
This perl script allows to determine the structural differences between two SGML files. It compares the files, regardless of what is in
between the tags, to only focus on the markup. Its output is similar to diff(1).
The typical use of sgmldiff is to compare an SGML file with its translation into another language. If the translation was done cleanly,
sgmldiff returns without finding any difference in the markup.
An example of a typical call to sgmldiff is:
sgmldiff english.sgml italiano.sgml
If there are differences in markup between both files, sgmldiff will output a series of differences reports summarized with lines of the
form:
169a164
At line 169 of the first file, line 164 of the second file has been added.
8a12,15
At line 8 of the first file, lines 12 to 15 of the second file have been added.
41d28 Line 41 of the first file has been destroyed, to obtain line 28 of the second file.
63,66d61
Lines 63 to 66 of the first file have been destroyed. to obtain line 61 of the second file.
52c51 Line 52 of the first file has been changed into line 51 of the second file.
5,7c8,10
Lines 5 to 7 of the first file have been changed into lines 8 to 10 of the second line. In addition to those summaries, the lines
of the first file are shown preceeded by '<' and the lines of the second file are shown preceeded by '>".
OPTIONS
Here is the list of actions that can be requested to sgmldiff:
[ -a | --attributes ]
Include the attribute values in the difference tests. Don't set this value if the attributes are likely to be translated. Set this
value if the attributes value shouldn't change between both files. Default is to don't include the attributes in the difference
tests.
[ -c [ attributes | nesting | textpos ] | --context [ attributes | nesting | textpos ] ]
Add more context to the difference. Since every test between the tags is removed before testing the differences, sgmldiff is likely
to resynchronize itself at the wrong place, by thinking the location in both files correspond, while it's not true. By adding more
context to the compared area, such risk is disminished.
The allowed values for the --context option are:
attributes
Take into account the attribute names. The attribute values are controlled by the attributes option.
nesting
Take into account the nesting level of all the compared tags.
textpos
Take into account the position in the text.
[ -s | --statistics ]
Print some SGML information at the end.
[ -h | --help ]
Print a short help message and exit
[ -v | --version ]
Print the version identifier and exit
FILES AUTHORS
Frederik Fouvry
Developer of sgmldiff.
SEE ALSO jw(1)
conversion from a SGML file to other file formats
nsgmls(1)
a base component of Jade DSSSL engine
http://sources.redhat.com/docbook-tools/ <URL:http://sources.redhat.com/docbook-tools/>
the home page of the DocBook tools, a compendium of all tools necessary to process DocBook files, including the DocBook-utils
11 February 2004 SGMLDIFF(1)