Perl one-liner convert to script format problem asking
Input_file_1:
Input_file_2:
Perl one-liner that join two input file based on columns sharing a value (In this example, column 2 in Input_file_1 and column 1 in Input_file_2 sharing a value):
Based on the above perl one-liner, do anybody got idea to change the above perl one liner into a perl shell script which allow us to type in any two input file and any column interest for merging when running the perl command?
Ideal running format:
Thanks for any advice.
Last edited by perl_beginner; 12-16-2011 at 01:17 PM..
I'm writing a script to automate some post-install tasks on RHEL4 servers.
I need the following code to insert an 'A' in the middle of a string, then replace the string in a file. I know I can use sed to do this, but I'd like to use perl's in place edit so I don't have to write to a temp file,... (1 Reply)
I have scripts which I want to convert in Linux format.
Note these scripts are in txt format.But I want to convert them in Linux, as DBA's will be using this script.
Any command or utility which converts tht files in proper Linux format.
Thanks in Adavce.
Kunal (1 Reply)
Hi all perl gurus,
I need your help to get the desired output in perl.
I have a file which has text in it in the format
Connection request start timestamp = 12/08/2008 00:58:36.956700
Connect request completion timestamp = 12/08/2008 00:58:36.959729
Application idle time ... (10 Replies)
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
I am new for Perl I want to ask one question. I have around 50 custom packages which i am using in my Perl script. I want to import all .pm packages in my Perl script in an easy way. Right now i have to import each package individually. So Is there any way to do so??
Right Now i am doing like:
... (1 Reply)
I have the following perl one-liner to get yesterday's date, but I would like it in the form of dd-MMM-yy (for example: 01-JAN-12). Can someone alter the below code so I get the format I want? Also, could someone also give me a line for dd-Mmm-yy (for example 01-Jan-12)?
Code:
YEST=`perl -w... (3 Replies)
Hi Folks,
I have written a perl script that reads data from excel sheet(.xls) using Spreadsheet::ParseExcel module. But the problem is this module doesn't work for excel sheets with extension .xlsx.
I have gone through Spreadsheet::XLSX module with which we can read from .xlsx file directly.... (1 Reply)
Hello, I need to get few values from a XML file and output needs to be written in another file with pipe delimited format. The Header & Footer of the Pipe Delimited file will be constant.
The below is my sample XML file. I need to pull the values in between the XML tags <Operator_info to... (15 Replies)
Hi
I want to replace time stamp in the following line
PROCNAME.Merge.exchMon.CODE.T_QSTART 08:45 read
assuming the new time stamp is 09:45 ; the line is getting replaced as below
:45 read
I'm trying to use the perl one liner in bash script
perl -pi... (4 Replies)
Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMUsernContributed Perl Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings(3pm)NAME
Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings - Map blocks should have a single statement.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
The map function can be confusing to novices in the best of circumstances. Mappings with multiple statements are even worse. They're also
a maintainer's nightmare because any added complexity decreases readability precipitously. Why? Because map is traditionally a one-liner
converting one array to another. Trying to cram lots of functionality into a one-liner is a bad idea in general.
The best solutions to a complex mapping are: 1) write a subroutine that performs the manipulation and call that from map; 2) rewrite the
map as a for loop.
CAVEATS
This policy currently misses some compound statements inside of the map. For example, the following code incorrectly does not trigger a
violation:
map { do { foo(); bar() } } @list
CONFIGURATION
By default this policy flags any mappings with more than one statement. While we do not recommend it, you can increase this limit as
follows in a .perlcriticrc file:
[BuiltinFunctions::ProhibitComplexMappings]
max_statements = 2
AUTHOR
Chris Dolan <cdolan@cpan.org>
CREDITS
Initial development of this policy was supported by a grant from the Perl Foundation.
COPYRIGHT
Copyright (c) 2007-2011 Chris Dolan.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.22012-06-07Perl::Critic::Policy::BuiltinFunctions::ProhibitComplexMappings(3pm)