Hello,
I barely know the basics, but I am very determined to learn. I want to parse a few characters from each row, use that string to search another file and display the line number where I found the value in the file. I don't know if this can all be done on the command line, so I am creating a... (2 Replies)
Hi All,
I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text.
An example of 4 lines in my file is:
1. MatchText_randomNumberOfText moreData ReplaceMe moreData
2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Hi All,
I have a file that I need to be able to find a pattern match on a line, take the number on that line check if its >0.9 or <0.1 and if this is true write the line to output.out file.
An example of 4 lines in my file is:
1. driver.I177.I11.net010 1.48622200477273e-05
2.... (2 Replies)
Hi,
I have got this value 18:21:23.330 in one of my variables.
Now I need to parse this time to something.
And then I have to compare it with 2 times, let's say, 15:00 hrs to 23:00 hrs.
Can Date::Manip rescue me from this horrifying situation?
I am quite new to Perl and especially this... (1 Reply)
Dear All,
i want to search particular string and want to replance next line value.
following is the test file.
search string is
tmp,???
,10:1 "???" may contain any 3 character it should remain the same and next line replace with ,10:50
tmp,123 --- if match tmp,??? then... (3 Replies)
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Hi Perl Guys
I have another perl question
I have the following code that i have written
Getopt::Long::config(qw( permute bundling ));
my $OPT = {};
GetOptions($OPT, qw(
ver=s
help|h
)) or die "options parsing failed";
This will allow the user to do something like... (4 Replies)
Hi folks,
I have a line in log from which I need to parse few data.
Jul 6 00:05:58 dg01aipagnfe01p %FWSM-3-106011: Deny inbound (No xlate)
From the above... I need to parse the %FWSM-3-106011: substring.
Another example
Jul 13 00:08:55 dq01aipaynas01p %FWSM-6-302010: 2 in use, 1661... (3 Replies)
Hi,
Need your help for this scripting issue I have. I am not really good at this, so seeking your help.
I have a file looking similar to this:
Hello, i am human and name=ABCD.
How are you?
Hello, i am human and name=PQRS.
I am good.
Hello, i am human and name=ABCD.
Good bye.
Hello, i... (12 Replies)
Discussion started by: royzlife
12 Replies
LEARN ABOUT DEBIAN
arch::diffparser
Arch::DiffParser(3pm) User Contributed Perl Documentation Arch::DiffParser(3pm)NAME
Arch::DiffParser - parse file's diff and perform some manipulations
SYNOPSIS
use Arch::DiffParser;
my $dp = Arch::DiffParser->new;
# usable for "annotate" functionality
my $changes = $dp->parse_file("f.diff")->changes;
$dp->parse($diff_content);
$dp->parse("--- f1.c 2005-02-26
+++ f2.c 2005-02-28
...");
# prints "f1.c, f2.c"
printf "%s, %s
", $dp->filename1, $dp->filename2;
# enclose lines in <span class="patch_{mod,orig,line,add,del}">
my $html = $dp->markup_content;
DESCRIPTION
This class provides a limited functionality to parse a single file diff in unified format. Multiple diffs may be parsed sequentially. The
parsed data is stored for the last diff, and is replaced on the following parse.
METHODS
The following class methods are available:
new, parse, parse_file, content, lines, filename1, filename2, mtime1, mtime2, hunks, changes.
new Construct the "Arch::DiffParser" instanse.
parse diff_content
Parse the diff_content and store its parsed data.
parse_file diff_filename
Like parse, but read the diff_content from diff_filename.
diff_data
Return hashref containing certain parsed data. Die if called before any parse methods. The keys are: "lines", "filename1", "filename2",
"mtime1", "mtime2", "hunks", "changes".
The value of "hunks" and "changes" is arrayref of arrayrefs with 5 elements: [ line-number-1, num-lines-1, line-number-2, num-lines-2,
"lines"-index ].
A "hunk" describes a set of lines containing some combination of unmodified, deleted and added lines, a "change" describes an inter-
hunk atom that only contains zero or more deleted lines and zero or more added lines.
lines
filename1
filename2
mtime1
mtime2
hunks
changes
These methods are just shortcuts for diff_data->{method}.
content [%args]
Return content of the last diff.
%args keys are "fileroot1" and "fileroot2"; if given, these will replace the subdirs "orig" and "mod" that arch usually uses in the
filepaths.
markup_content [%args]
Like content, but every non-context line is enclosed into markup <span class="patch_name">line</span>, where name is one of "orig"
(filename1), "mod" (filename2), "line" (hunk linenums), "add" (added), del (deleted).
Not implemented yet.
BUGS
No support for newlines in source file names yet.
AUTHORS
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).
SEE ALSO
For more information, see Text::Diff::Unified, Algorithm::Diff.
perl v5.10.1 2005-03-09 Arch::DiffParser(3pm)