Using awk or sed command how can i encrypt the characters for a particular column.For every character it should replace the third charter of alphabets.Example replace "A" with "C" and "B" with "D"..like this it should replace for all characters in particular column.
Using below command i am able to replace the values in particular column.but not sure to replace like explain above.
Last edited by Corona688; 09-02-2015 at 02:55 PM..
Reason: removed unnecessary quote
Following code may help you in same. Let's say we have an example file named file_1.
Output will be as follows. EDIT: Adding a non one-liner form for solution now. EDIT2: Here I want to mention fact that I have put logic here in code so when letter y or z comes in column 3rd then those letters will be remained as it is, if you need them too changed to, you can try it with a minor change in if section, where I am setting array D's value.
EDIT3: Previous solution was having only small letters logic, adding small and block letters in solution now.
Example for above code:
Thanks,
R. Singh
Last edited by RavinderSingh13; 09-03-2015 at 02:23 AM..
Reason: added a non one-liner form for solution now. Added a note for solution.
Comments on the the previous solution:
The split() and the following loop are static; it is more efficient to place them in the BEGIN section.
And in the main section it is better to initialize a loop variable (use a for loop!), in case there is more than one line.
The split( , , "") is not understood by all awk versions, others might need
--
Here is a solution with a string
Last edited by MadeInGermany; 09-02-2015 at 05:28 PM..
Reason: retain characters that do not match
Good morning everyone,
I'm looking for some help to retrieve data in a scenario where I might have made a big mistake. I'm hoping to understand what I did wrong.
My system is made of two Solaris 11 Express servers (old free version for evaluation). The first if for data and the second is... (7 Replies)
Hi all,
I'm looking for secure file encryption tools that use MAC address as encryption key. FYI, I'm using Red Hat Enterprise Linux OS.
For example: when A wants to send file to B
A will encrypt the file with B's computer MAC/IP address as an encryption key
This file can only be decrypted... (2 Replies)
In unix, i know the password encrypt by using salt
But how does it work? And how windows protect its password?
Thank you for helping in advance (5 Replies)
Hi
I have created a user in snmpv3 as myuser n gave a password.
Its also feching data by snmpget.
Then I created another user as arika and the password is same as myuser..
Now I am trying to change the password by the command :
snmpusm -v 3 -u arika -l authNoPriv -a MD5 -A my_password... (1 Reply)
My dilemma,
I need to send, deemed confidential, information via e-mail (SMTP). This information is sitting as a file on AIX. Typically I can send this data as a e-mail attachment via what we term a "mail filter" using telnet. I now would like to somehow encrypt the data and send it to a e-mail... (1 Reply)
NEED expertise help for this topic!!!
Question 1: Is encryption possible for the shell scriping programing? shadow the scriping file, do think is impossible...
Question2: built a simple program with the simplicity function that allow user change settings by enter corret name and... (3 Replies)
hello ppl,
i've been coding a perl script for xchat and i need to store the nick's passwords. i was wondering which encryption to use. picture this situation: i've got a system flaw and some guy hacks the machine and gets his hands on the passwd file; he has access to the script. what encryption... (2 Replies)