logo
down
shadow

awk command to create sha2 of individual column and paste into new file


awk command to create sha2 of individual column and paste into new file

By : Svetoslav Manchev
Date : November 22 2020, 04:01 AM
hope this fix your issue I have a file of having multiple rows. Using that original file I am creating one more files but in that new file i am taking only few columns of the original files. , Try this :
code :
awk -F"|" -v var="10" '
    NR==1;
    NR>1{
        "echo "$2"|sha256sum" | getline shaoutput; 
        split(shaoutput, sha, " "); 
        print var, $2, $3, $4, $5, sha[1]
    }' OFS="|" file
10|0001001010000026316|531849|1150|101|2e16abd9f3e3e368210b11faa5bfebdb6e001034b58cc9ad1c689dfd1f7eeacd
awk -v var="10" '
    BEGIN{
        FS=OFS="|"
    }
    NR==1;
    NR>1{
        shaoutput="";
        cmd="echo \047" $2 "\047 | sha256sum" ;
        if ( (cmd | getline line) > 0 ){
            shaoutput=line
            close(cmd)
        }
        split(shaoutput, sha, " ");
        print var, $2, $3, $4, $5, sha[1];
    }' file


Share : facebook icon twitter icon
Create File Speedily From Individual Column

Create File Speedily From Individual Column


By : Mori Yagi
Date : March 29 2020, 07:55 AM
it helps some times I have a data that looks like this:
code :
#!/usr/bin/sh

for i in `seq 1 $1`; do
    cut -f1,$i $2 > ${2}_$i;
done
#!/usr/bin/perl

use warnings; use strict;

my $input_file = $ARGV[0];
my %handles;

while (<>) {
    my ($class, @features) = split /\s+/;

    for my $i (1 .. @features) {
        open $handles{$i}, '>', $input_file . "_$i" or die $!
        unless exists $handles{$i};

        print {$handles{$i}} join( ' ', $class, $features[$i - 1] ), "\n";       
    }
}

while (my (undef, $handle) = each %handles) {
    close $handle or die $!;
}
How to create a different key-command sets for individual JQuery tabs?

How to create a different key-command sets for individual JQuery tabs?


By : user3529358
Date : March 29 2020, 07:55 AM
Does that help How to create different key-command sets for use with different JQuery tabs. , use a global variable
code :
var tab_id = 'tab-1';
$('.tab').click(function(){

   tab_id = $(this).attr('id');

});
    $('body').keypress(function(e){

         var code = (e.keyCode ? e.keyCode : e.which);
         if(code == 49) {

              $("#"+tab_id+" > #button_1").trigger('click'); 
         }
         else if(code == 50) {

              $("#"+tab_id+" > #button_2").trigger('click'); 
         }
   });
Linux -- How to cut a column from one file and paste into another in a one-line command?

Linux -- How to cut a column from one file and paste into another in a one-line command?


By : Dumitru Zagareanu
Date : March 29 2020, 07:55 AM
Does that help If you can live with a tab separator (or another single character) you can do
code :
cut [column-spec] file1 | paste file2 - > file3
How to create and store a SHA2-512 hash with PHP

How to create and store a SHA2-512 hash with PHP


By : Hassan Khademi
Date : March 29 2020, 07:55 AM
This might help you Hexadecimal identifiers make your tables and indexes bigger and slow down comparisons. I suggest you to do not use it but if you must use hexadecimal values for identifier you can make it binary.
You can hash like that;
code :
$hashed_password = hash('sha512', $password);
VBA Command Button - Copy and Paste Column with Column Name Match

VBA Command Button - Copy and Paste Column with Column Name Match


By : haki
Date : March 29 2020, 07:55 AM
it should still fix some issue Right click on the activeX button,click on view code and paste the following code there
code :
'This is the location of all the headers one of which is the header in C17
Set lookup_rng = Range("H17:Q17")  

For Each cell In lookup_rng
    If cell.Value = Range("C17").Value Then
        Range("C18:C123").Copy
        cell.Offset(1, 0).Select
        Selection.PasteSpecial Paste:=xlPasteValues
        Selection.PasteSpecial Paste:=xlPasteFormats
        Application.CutCopyMode = False
    End If
Next cell
Related Posts Related Posts :
  • Bash script For Loop contains if/else issue
  • vi replace visual mode selection with clipboard
  • How to redirect external incoming traffic from one port to another? (Linux/iptables/ufw)
  • Update failure in Ubuntu 18
  • How to add values of all columns of various .csv files keeping only single header and the first label column the same?
  • Linux libc++ seems to be broken
  • Curl GET generating unauthorized access error
  • Problem with connect Oracle DB sqlplus / as sysdba (unset TWO_TASK)
  • How can I reduce the virtual memory required by gccgo compiled executable?
  • array under sh shell (not bash)
  • xargs -0 produce new line
  • How to bring GEdit to front using Java on Linux
  • Only USERID, PID, TIME, and COMMAND for specific user Shell Script
  • mount option stripe not defined in fstab
  • Run script in a new screen if true
  • is it useful to use 'wait' after using linux GNU parallel?
  • Difference between Serial and USB devices on Linux?
  • user privilege to create schedule jobs Centos
  • Transform a "table-data" file in CSV
  • VMStat ran everyday at midnight with the time before each entry
  • ampersand at beginning of a line in csh
  • NSIS support for Linux and Solaris
  • Library for remote file access in linux?
  • VMWare Linux image with small footprint
  • output from linux pipe in two inpdendent files
  • How can I find out what these files or processes do (linux)
  • How is stack size of Linux process related to pthread, fork and exec
  • good text-based powerful java IDE that runs on linux
  • Maximum number of concurrent connections on a single port (socket) of Server
  • Why would Linux reuse a file descriptor allocated by pipe()
  • Monitor a process
  • Drop a single sample from munin data
  • How to fetch cpu utilization of a particular process in linux
  • Linux kernel - add system call dynamically through module
  • Conflict between system call number and system call handler pointer
  • How to get interface index from interface ip addres
  • why gcc 4.x default reserve 8 bytes for stack on linux when calling a method?
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org