Here is my situation. I need to compare two tab separated files (diff is not useful since there could be known difference between files).
I have found similar posts , but not fully matching.I was thinking of writing a shell script using cut and grep and while loop but after going thru posts it... (2 Replies)
Hi All,
I'm looking for a script which can transpose field names from column headers to values in one column.
for example, the input is:
IDa;IDb;IDc;PARAM1;PARAM2;PARAM3;
a;b;c;p1val;p2val;p3val;
d;e;f;p4val;p5val;p6val;
g;h;i;p7val;p8val;p9val;
into the output like this:
... (6 Replies)
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Hi Guys
I have the following file
Essentially, I am trying to find the right awk/sed syntax in order to produce the following 3 distinct files from the file above:
Basically, I want to print the lines of the file as long as the second field of the current line is equal to the... (9 Replies)
Hi Friends,
I am new to Shell Scripting and need your help in the below situation.
- I have two files (File 1 and File 2) and the contents of the files are mentioned below.
- "Application handle" is the common field in both the files.
(NOTE :- PLEASE REFER TO THE ATTACHMENT "Compare files... (2 Replies)
Hi Friends,
Need Help. I have file1.txt as
File1.txt
|123|A|7267|Hyder|Cross|Sell|7801
|995|A|7051|2008|Lunar|New|Year|Promotion|7801
|996|A|7022|Q108|Targ|Prospect|&|SSCC|Savings|Promo|7801
|997|A|7182|Q1|Feb-Apr|08|Credit|ITA|PA|SBA|Campaign|7801
File2.txt... (7 Replies)
Hi Freinds,
I have 2 files . one is source.txt and second one is target.txt. I want to keep source.txt as baseline and compare target.txt. please find the data in 2 files and Expected output.
Source.txt
1|HYD|NAG|TRA|34.5|1234
2|CHE|ESW|DES|36.5|134
3|BAN|MEH|TRA|33.5|234... (5 Replies)
Hi guys, looking for some help with a way to compare data in two files but with some conditions.
example,
File 1 consists of
site1,10.1.1.1
site2,20.2.2.2
site3,30.3.3.3
File 2 contains
site1,l0.1.1.1
site2,50.1.1.1
site3,30.3.3.3
site4,40.1.1.1
I want to be able to match the... (1 Reply)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Perl::Critic::Policy::InputOutput::RequireEncodingWithUTUseryContributed Perl Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer(3pm)NAME
Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer - Write "open $fh, q{<:encoding(UTF-8)}, $filename;" instead of "open $fh,
q{{<:utf8}, $filename;".
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Use of the ":utf8" I/O layer (as opposed to ":encoding(UTF8)" or ":encoding(UTF-8)") was suggested in the Perl documentation up to version
5.8.8. This may be OK for output, but on input ":utf8" does not validate the input, leading to unexpected results.
An exploit based on this behavior of ":utf8" is exhibited on PerlMonks at <http://www.perlmonks.org/?node_id=644786>. The exploit involves
a string read from an external file and sanitized with "m/^(w+)$/", where $1 nonetheless ends up containing shell meta-characters.
To summarize:
open $fh, '<:utf8', 'foo.txt'; # BAD
open $fh, '<:encoding(UTF8)', 'foo.txt'; # GOOD
open $fh, '<:encoding(UTF-8)', 'foo.txt'; # BETTER
See the Encode documentation for the difference between "UTF8" and "UTF-8". The short version is that "UTF-8" implements the Unicode
standard, and "UTF8" is liberalized.
For consistency's sake, this policy checks files opened for output as well as input, For complete coverage it also checks "binmode()"
calls, where the direction the operation can not be determined.
CONFIGURATION
This Policy is not configurable except for the standard options.
NOTES
Because "Perl::Critic" does a static analysis, this policy can not detect cases like
my $encoding = ':utf8';
binmode $fh, $encoding;
where the encoding is computed.
SEE ALSO
PerlIO
Encode
"perldoc -f binmode"
<http://www.socialtext.net/perl5/index.cgi?the_utf8_perlio_layer>
<http://www.perlmonks.org/?node_id=644786>
AUTHOR
Thomas R. Wyant, III wyant at cpan dot org
COPYRIGHT
Copyright (c) 2010-2011 Thomas R. Wyant, III
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::InputOutput::RequireEncodingWithUTF8Layer(3pm)