05-12-2016
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Oracle procedure create files on UNIX folder on a regular basis. I need to FTP files onto windows server and place the files, based on their name, in the corresponding folders. File name is as follows: ccyymmddfoldernamefile.txt; Folder Name length could be of any size; however, the prefix and... (3 Replies)
Discussion started by: MeganP
3 Replies
2. Shell Programming and Scripting
Folks,
I have a bit of an issue trying to obtain some data from a csv file using PERL. I can sort the file and remove any duplicates leaving only 4 or 5 rows containing data. My problem is that the data contained in the original file contains a lot more columns and when I try ro run this script... (13 Replies)
Discussion started by: lodey
13 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
Currently i have to write a script.
For which i need to cut a block from .txt file.
I know the specific word that starts the block and ends the block.
Can we do it in shell scripting..?
Please suggest.... (6 Replies)
Discussion started by: pank29
6 Replies
4. Shell Programming and Scripting
Is there any way to convert numeric values txt file to PACKED DECIMAL File using PERL.
Regards,
Alok (1 Reply)
Discussion started by: aloktiwary
1 Replies
5. Shell Programming and Scripting
Hi,
I have the file like this:
#Contents of file 1 are:
Dec 10 12:33:44 User1 Interface: Probe
Dec 10 12:33:47 uSER1 SOME DATA
Dec 10 12:33:47 user1 Interface: MSGETYPE
Dec 10 12:34:48 user1 ID: 10.
Dec 10 12:33:55 user1 Interface: MSGTYPE
Dec 10 12:33:55 user1 Id: 9
... (1 Reply)
Discussion started by: vanitham
1 Replies
6. Shell Programming and Scripting
Hi,
I want to split/parse certain bits of the hex data into another field.
Example:
Input data is
Word1: 4f72abfd
Output:
Parse bits (5 to 0) into field word1data1=0x00cd=205 decimal
Parse bits (7 to 6) into field word1data2=0x000c=12 decimal
etc.
Word2: efff3d02
Parse bits (13 to... (1 Reply)
Discussion started by: morrbie
1 Replies
7. Shell Programming and Scripting
Hi all the experts out there,
I am totally new to perl and I was given an assignment by using Perl to find the 2nd element of each line in each curly bracket which made up of 5 elements.
Expected result should like this:
Type: VCC Pin_name: AK32,AL32,AH21,.....
Type: NC Pin_name:... (2 Replies)
Discussion started by: killbanne
2 Replies
8. Shell Programming and Scripting
Hi,
I`m a total newbie, well my requirement is that i have 2 files
I want to identify which countries i do not currently have in db..
how can i use the grep or another command to find this file ..
i want to match all-countries.txt with countries-in-db.txt so the output is equal to... (11 Replies)
Discussion started by: beanbaby
11 Replies
9. Shell Programming and Scripting
I have an input file attached that I am trying to parse in tab-delimanted format:
The chromosomal variant column contains all the information:
parse rules:
1. 4 zeros after the NC_ and the digits before the .
2. digits after the g. repeated twice separated by a tab
3. letter before the >
4.... (10 Replies)
Discussion started by: cmccabe
10 Replies
10. Linux
Test jython (3 Replies)
Discussion started by: morpheus59
3 Replies
LEARN ABOUT DEBIAN
parse::mediawikidump::links
Parse::MediaWikiDump::Links(3pm) User Contributed Perl Documentation Parse::MediaWikiDump::Links(3pm)
NAME
Parse::MediaWikiDump::Links - Object capable of processing link dump files
ABOUT
This object is used to access content of the SQL based category dump files by providing an iterative interface for extracting the
indidivual article links to the same. Objects returned are an instance of Parse::MediaWikiDump::link.
SYNOPSIS
$pmwd = Parse::MediaWikiDump->new;
$links = $pmwd->links('pagelinks.sql');
$links = $pmwd->links(*FILEHANDLE);
#print the links between articles
while(defined($link = $links->next)) {
print 'from ', $link->from, ' to ', $link->namespace, ':', $link->to, "
";
}
STATUS
This software is being RETIRED - MediaWiki::DumpFile is the official successor to Parse::MediaWikiDump and includes a compatibility library
called MediaWiki::DumpFile::Compat that is 100% API compatible and is a near perfect standin for this module. It is faster in all instances
where it counts and is actively maintained. Any undocumented deviation of MediaWiki::DumpFile::Compat from Parse::MediaWikiDump is
considered a bug and will be fixed.
METHODS
Parse::MediaWikiDump::Links->new
Create a new instance of a page links dump file parser
$links->next
Return the next available Parse::MediaWikiDump::link object or undef if there is no more data left
EXAMPLE
List all links between articles in a friendly way
#!/usr/bin/perl
use strict;
use warnings;
use Parse::MediaWikiDump;
my $pmwd = Parse::MediaWikiDump->new;
my $links = $pmwd->links(shift) or die "must specify a pagelinks dump file";
my $dump = $pmwd->pages(shift) or die "must specify an article dump file";
my %id_to_namespace;
my %id_to_pagename;
binmode(STDOUT, ':utf8');
#build a map between namespace ids to namespace names
foreach (@{$dump->namespaces}) {
my $id = $_->[0];
my $name = $_->[1];
$id_to_namespace{$id} = $name;
}
#build a map between article ids and article titles
while(my $page = $dump->next) {
my $id = $page->id;
my $title = $page->title;
$id_to_pagename{$id} = $title;
}
$dump = undef; #cleanup since we don't need it anymore
while(my $link = $links->next) {
my $namespace = $link->namespace;
my $from = $link->from;
my $to = $link->to;
my $namespace_name = $id_to_namespace{$namespace};
my $fully_qualified;
my $from_name = $id_to_pagename{$from};
if ($namespace_name eq '') {
#default namespace
$fully_qualified = $to;
} else {
$fully_qualified = "$namespace_name:$to";
}
print "Article "$from_name" links to "$fully_qualified"
";
}
perl v5.10.1 2010-12-05 Parse::MediaWikiDump::Links(3pm)