I have a file, not really a csv, but containing delineated data just the same. Lets call that file "raw_data.txt". It contains data in the format of company name:fein number like this:
what i need to do is read this file, apply sha1 to the fein field and then output that into a new file, we'll call "hashed_data.txt". So hashed_data.txt should contain data like
i have tried looping thru the file with awk like so
but I'm stuck on how to run the second field thru sha1sum
Hi
I have a CSV file with me in this format
Currency, USD, EUR,
USD, 1.00, 1.32,
EUR, 0.66, 1.00,
How do I transpose the file to get to the format below.
currency, currency, rate
USD, USD, 1.00
USD, EUR, 1.32
EUR, USD, 0.66
EUR, EUR, 1.00
Thanks for your help
We are using... (2 Replies)
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)
Hi,
It's been a few years since college when I did stuff like this all the time. Can someone help me figure out how to best tackle this problem? I need to parse a file full of entries that look like this:
<eq action="A" sectyType="0" symbol="PGR" exch="CA" curr="VEF" sess="NORM"... (7 Replies)
Hi,
Our requirement is to parse the input file(.csv format). The each column in the file is delimited with comma. We need to take each column and apply some business validation rule.
If data itself contains comma, then those fields are enclosed with double quotes ("). We can see this double... (7 Replies)
hi
i want to generate SHA1 hash of string in Linux (atmark) and downloaded the XYSSL-0.9 version code for the same.i have the algorithm which takes file as argument and returns hash of file . And of same file while I generated the key using online tools then it doesn't match with my compiled... (4 Replies)
Hello Expert,
I have a file in the following format:
SYNTAX_VERSION 5
MONITOR "NAME_TEMPLATES"
DESCRIPTION "Monitors for contents of error "
INTERVAL "1m"
MONPROG "script.sh NAME_TEMPLATES"
MAXTHRESHOLD
GEN_BELOW_RESET
SEVERITY Major
... (17 Replies)
My source file looks like this:
Cust-Number = "101"
Cust-Name="Joe"
Cust-Town="London"
Cust-hobby="tennis"
Cust-purchase="200"
Cust-Number = "102"
Cust-Name="Mary"
Cust-Town="Newyork"
Cust-hobby="reading"
Cust-purchase="125"
Now I want to parse this file (leaving out hobby) and... (10 Replies)
I have a .csv file and I want to md5 hash the second column for each row in the file.
File is something like
data1,foobar1,123,345
data2,foobar2,456,9393
data3,foobar3,1002,10109
Output would be like
data1,6c81243028f8e455fa617dd5f0232ce1,123,345... (3 Replies)
I am not too savvy with arrays and am assuming that what I am looking for needs arrays. This is my requirement.
So I have the raw data that gets updated to a log as shown below
StudentInfo:
FullInfo = {
Address = Newark
Age = 20
Name= John
}
StudentInfo:... (2 Replies)
Discussion started by: sidnow
2 Replies
LEARN ABOUT DEBIAN
authen::simple::activedirectory
Authen::Simple::ActiveDirectory(3pm) User Contributed Perl Documentation Authen::Simple::ActiveDirectory(3pm)NAME
Authen::Simple::ActiveDirectory - Simple ActiveDirectory authentication
SYNOPSIS
use Authen::Simple::ActiveDirectory;
my $ad = Authen::Simple::ActiveDirectory->new(
host => 'ad.company.com',
principal => 'company.com'
);
if ( $ad->authenticate( $username, $password ) ) {
# successfull authentication
}
# or as a mod_perl Authen handler
PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::ActiveDirectory
PerlSetVar AuthenSimpleActiveDirectory_host "ad.company.com"
PerlSetVar AuthenSimpleActiveDirectory_principal "company.com"
<Location /protected>
PerlAuthenHandler Authen::Simple::ActiveDirectory
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>
DESCRIPTION
Authenticate against Active Directory.
This implementation differs from Authen::Simple::LDAP in way that it will try to bind directly as the users principial.
METHODS
o new
This method takes a hash of parameters. The following options are valid:
o host
Connection host, can be a hostname, IP number or a URI. Defaults to "localhost".
host => ldap.company.com
host => 10.0.0.1
host => ldap://ldap.company.com:389
host => ldaps://ldap.company.com
o port
Connection port, default to 389. May be overridden by host if host is a URI.
port => 389
o timeout
Connection timeout, defaults to 60.
timeout => 60
o principal
The suffix in users principal, usally the domain or forrest. Required.
principal => 'company.com'
o log
Any object that supports "debug", "info", "error" and "warn".
log => Log::Log4perl->get_logger('Authen::Simple::ActiveDirectory')
o authenticate( $username, $password )
Returns true on success and false on failure.
SEE ALSO
Authen::Simple::LDAP.
Authen::Simple.
Net::LDAP.
AUTHOR
Christian Hansen "chansen@cpan.org"
COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-04-23 Authen::Simple::ActiveDirectory(3pm)