Hello guys/gals,
i am sorry as this is probably very simply but i am slowly learning perl and need to convert some old korn shell scripts.
I need to be able to search a file line by line but only match a string at particular location on that line, for example character 20-30. So my file... (4 Replies)
Hi All
I want to search a string from an array in Perl. If a match occurs, assign that string to a variable else assign 'No match'. I tried writing the script as follows but it's in vain. Please help me..
#!/usr/bin/perl
use strict;
my $NER;
my @text=("ORG","PER");
... (4 Replies)
Hi,
I have a file having around 30 records. Each record has 5 fields delimited by PIPE. Few records in the file having Junk characters in the field2 and field4.
I found the junk charcter and I tested it and replace the junk with space with the command below
perl -i -p -e "s/\x00/ /g"... (1 Reply)
Hi,
I am using KSH shell to do some programming.
I want to search array and print index value of the array.
Example..
nodeval4workflow="DESCRIPTION ="" ISENABLED ="YES" ISVALID ="YES" NAME="TESTVALIDATION"
set -A strwfVar $nodeval4workflow
strwfVar=DESCRIPTION=""... (1 Reply)
How to reverse search for a matched string in a file. Get line# of the first matched line. I am getting '2' into 'lineNum' variable.
But it feels like I am using too many commands. Is there a better more efficiant way to do this on Unix?
abc.log
aaaaaaaaaaaaa
bbbbbbbbbbbbb... (11 Replies)
Hi,
I want the Perl script with versions 5.8.2 and 5.8.5 starting with
#!/usr/bin/perl
The Perl program should read the excel file or text file line by line and taking into an array and search in the UNIX directories for reference file of .jsp or .js or .xsl with path .The Object names... (2 Replies)
Hi,
i want to search and replace array values by using perl
perl -pi -e "s/${d$i]}/${b$j]}" *.xml
i am using while loop for the same. if i excute this,it shows "Substitution replacement not terminated at -e line 1.".
please tell me what's wrong this line (1 Reply)
I'm trying to find a way to search a range of similar words in a file. I tried using sed but can't get it right:sed 's/\(ca01\)*//'It only removes "ca01" but leaves the rest of the word. I still want the rest of the information on the lines just not these specific words listed below. Any... (3 Replies)
How to grep for searching a string within a begin and end pattern of a file.
Sent from my Redmi 3S using Tapatalk (8 Replies)
Discussion started by: Baishali
8 Replies
LEARN ABOUT DEBIAN
perldig
PERLDIG(1p) User Contributed Perl Documentation PERLDIG(1p)NAME
perldig - Dig up keywords in the local Perl documentation
SYNOPSIS
# Update the index (required before first start)
perldig -u
# Search for a keyword
perldig keyword(s)
DESCRIPTION
When using "perldig" for the first time, a new index needs to be created. Just call
$ perldig -u
and everything happens automatically: A crawler will detect locally installed Perl documentation pages, rummage through the POD and index
them. When this initial run has been completed, "perldig" is ready to process search requests:
$ perldig frobnicate
1) pod/perlguts.pod 2) pod/perlxstut.pod 3) pod/perlnewmod.pod
Enter number of choice:
The command above shows a search for the keyword "frobnicate". Yes, that's a word used in the Perl documentation! It shows three hits and
asks the user to enter a number between 1 and 3 to open the selected documentation page in a pager program (typically "less"). In there, an
in-text search for the expression can be started by using the "/" (slash) command.
If two or more keywords are given, the search will yield pages that contain all of them. When searching for phrases, please include quotes
(make sure to quote the quotes so the shell doesn't eat them):
$ perldig '"floating point"'
The underlying swish-e search engine also understands expressions connected via AND and OR:
$ perldig "'floating point' AND approximate AND 'real number'"
To keep the index up to date, it is probably a good idea to run a cronjob every morning:
00 4 * * * /usr/bin/perldig -u >/dev/null 2>&1
If you can read German, please check out this article in the "Linux- Magazin", where this script was originally published:
http://www.linux-magazin.de/Artikel/ausgabe/2003/10/perl/perl.html
EXAMPLES
# Update/create the index
$ perldig -u
$ perldig frobnicate
1) pod/perlguts.pod 2) pod/perlxstut.pod 3) pod/perlnewmod.pod
Enter number of choice: 1
[ ... perlguts man page shows ... ]
FILES
"perldig" puts the swish-e index files into the folder ".perldig" in the user's home directory.
LEGALESE
Copyright 2003-2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under
the same terms as Perl itself.
AUTHOR
2003, Mike Schilli <m@perlmeister.com>
perl v5.12.4 2005-08-22 PERLDIG(1p)