Sponsored Content
Top Forums Shell Programming and Scripting Apply md5 hash to a field in csv file Post 302966156 by Aia on Monday 8th of February 2016 11:00:52 PM
Old 02-09-2016
Code:
perl -MDigest::MD5=md5_hex -naF, -e 'BEGIN{$"=","} $F[1]=md5_hex($F[1]); print "@F"' jjwags.file

Code:
data1,6c81243028f8e455fa617dd5f0232ce1,123,345
data2,cbac77acf401ef89c3297bd9fc41ec0b,456,9393
data3,f8b8d6a7367c1e4e0d60c5ac26ba8b04,1002,10109

This User Gave Thanks to Aia For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create md5 Hash variable?

I have a script that runs the grub-md5-crypt command based on whether the pass_value variable is a non-zero string. The md5 hash is being created in the /opt/hostconfigs/$HOST file, but I can't echo $md5_value. It is blank. Is there a way to create and echo a md5 hash variable? if then... (1 Reply)
Discussion started by: cstovall
1 Replies

2. Programming

md5 hash a string or char array in SCO

Can someone provide me with code to md5 hash a string or character array in the SCO environment. All help is appreciated thanks. (5 Replies)
Discussion started by: jcarter2333
5 Replies

3. Programming

MD5 hash calculation

hi i want to generate MD5 hash of string in unix (hp) i have the algorithm which takes file as argument and returns hash of file but when i tried to generate hash of "a" result was "60b725f10c9c85c70d97880dfe8191b3" hash but actually it should have been "0cc175b9c0f1b6a831c399e269772661" now i... (4 Replies)
Discussion started by: zedex
4 Replies

4. Shell Programming and Scripting

MD5 hash filename

I am a newbie to shell programming. Can someone help me with the following ? Shell script that accomplishes the following - # Step 1 List all files in the directory # Step 2 Loop through each filename say a.htm and MD5 hash the filename to say b.htm # Step 3 copy a.htm to b.htm # Step 4... (1 Reply)
Discussion started by: bebar
1 Replies

5. Shell Programming and Scripting

parse csv file, sha1 hash and output

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: first company name:123456789 second company name:987654321 what i need to do is read this file, apply... (11 Replies)
Discussion started by: FreddyG
11 Replies

6. UNIX for Dummies Questions & Answers

How to convert MD5 hash into shadow format?

I am trying to use John the Ripper but it doesn't take regular MD5 hashes, only shadow MD5 hashes. For example this hash: 900150983cd24fb0d6963f7d28e17f72 (which, decrypted, is 'abc') within a text file, John the Ripper does not detect because it is not in shadow format. How can I convert this MD5... (2 Replies)
Discussion started by: guitarscn
2 Replies

7. Linux

How do I format a Date field of a .CSV file with multiple commas in a string field?

I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below: column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10 "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Discussion started by: dhruuv369
3 Replies

8. Shell Programming and Scripting

Perl giving unexpected md5 hash values

I am trying to speed up creating a line by line hash file from a huge file using Perl. Here is my current (working but too slow) Bash code: (while read line; do hash=$(echo -n $line | md5sum); echo ${hash:0:32}; done)And here is my Perl code: perl -MDigest::MD5 -le 'foreach $line ( <STDIN> )... (3 Replies)
Discussion started by: Michael Stora
3 Replies

9. Shell Programming and Scripting

Match columns from two csv files and update field in one of the csv file

Hi, I have a file of csv data, which looks like this: file1: 1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628 2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Discussion started by: djoseph
10 Replies

10. Shell Programming and Scripting

How to reverse the b64 format(encoded b64(b64(md5($pass)))) into md5 hash format?

I have about 1500 rows (encoded b64(b64(md5($pass))) algorythm) in a file. I would like reverse the b64 into md5 hash format. How could I do that from command line? So I need only the correct md5 hash formats. These row format: 4G5qc2WQzGES6QkWAUgl5w P9tKxonBOg3ymr8vOBLnDA... (1 Reply)
Discussion started by: freeroute
1 Replies
CGI
::Application::Plugin::Authentication::Driver::FilterUser5Contributed Perl DoCGI::Application::Plugin::Authentication::Driver::Filter::md5(3pm) NAME
CGI::Application::Plugin::Authentication::Driver::Filter::md5 - MD5 filter VERSION
This document describes CGI::Application::Plugin::Authentication::Driver::Filter::md5 version 0.20 METHODS
filter ( (hex base64 binary), $string ) This will generate an MD5 hash of the string in the requested format. By default, hex encoding is used. my $filtered = $class->filter('base64', 'foobar'); # OFj2IjCsPJFfMAxmQxLGPw -or- my $filtered = $class->filter(undef, 'foobar'); # 3858f62230ac3c915f300c664312c63f check ( (hex base64 binary), $string, $md5 ) This will generate an MD5 hash of the string, and compare it against the provided MD5 string. If no encoding type is specified, the length of the MD5 string will be tested to see what format it is in. if ($class->check(undef, 'foobar', '3858f62230ac3c915f300c664312c63f')) { # they match } SEE ALSO
CGI::Application::Plugin::Authentication::Driver, Digest::MD5, perl(1) AUTHOR
Cees Hek <ceeshek@gmail.com> LICENCE AND COPYRIGHT
Copyright (c) 2005, SiteSuite. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.3 2011-05-16 CGI::Application::Plugin::Authentication::Driver::Filter::md5(3pm)
All times are GMT -4. The time now is 09:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy