Sponsored Content
Top Forums UNIX for Beginners Questions & Answers How to replace matching words defined in one file on another file? Post 303036132 by RudiC on Saturday 15th of June 2019 03:21:51 AM
Old 06-15-2019
This problem has been solved umpteen times in these fora. Did you bother to search, or look into the proposals given below under "More UNIX and Linux Forum Topics You Might Find Helpful"?


Howsoever, try

Code:
awk 'FNR==NR{REP[$1]=$2; next} {for (r in REP) gsub(r, REP[r])}1' FS="=" file2 file1

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

getting file words as pattern matching

Sir, I want to check for the repation of a user address in a file i used || as my delimiter and want to check repetaip0n of the address that is mailid and then i have to use IMAP and all. How can i do this... I am in linux ...and my file is linux file. ... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

2. Shell Programming and Scripting

replace words in file based on another file

Hello, Can someone kindy help me solve this problem..I am using SunOS shell script I got a file A with following content: This is my correct document. I wrote 111 This is my incorrect word , 222 This is my wrong statement 333 This is my correct document 444 This is my correct document 555... (9 Replies)
Discussion started by: kinmak
9 Replies

3. UNIX for Dummies Questions & Answers

sed replace words in file and keep some

lets see if i can explain this in a good way. im trying to replace some words in a file but i need to know what the words are that is beeing replaced. not sure if sed can do this. file.name.something.1DATA01.something.whatever sed "s/./.DATA?????/g" need to know what the first . is... (2 Replies)
Discussion started by: cas
2 Replies

4. Shell Programming and Scripting

How to from grep command from a file which contains matching words?

Hi all I have a file with below content (content is variable whenever new product is launched). I need form a grep command like this egrep "Unknown product|Invalid symboland so on" How to do it using a script? Unknown product Invalid symbol No ILX exch found exceeds maximum size AFX... (4 Replies)
Discussion started by: johnl
4 Replies

5. Shell Programming and Scripting

search the pattern in a file and replace with variable already defined previously in csh

I want to replace a certain pattern with the variable already defined. e.g. set path_verilog = /home/priya/bin/verilogfile my file contents are : verilog new verilog is defined here verilog_path_comes I am using the below command sed 's/verilog_path_comes/'$path_verilog'/g' <filename>... (2 Replies)
Discussion started by: nehashine
2 Replies

6. Shell Programming and Scripting

Replace text in column1 of a file matching columns of another file

Hi all, I have 2 files: species-names.txt Abaca-bunchy-top-virus ((((Abaca-bunchy-top-virus((Babuvirus((Unassigned((Nanoviridae((Unassigned)))) Abutilon-mosaic-virus ((((Abutilon-mosaic-virus((Begomovirus((Unassigned((Geminiviridae((Unassigned))))... (2 Replies)
Discussion started by: thienxho
2 Replies

7. UNIX for Dummies Questions & Answers

Replace the words in the file to the words that user type?

Hello, I would like to change my setting in a file to the setting that user input. For example, by default it is ONBOOT=ON When user key in "YES", it would be ONBOOT=YES -------------- This code only adds in the entire user input, but didn't replace it. How do i go about... (5 Replies)
Discussion started by: malfolozy
5 Replies

8. Shell Programming and Scripting

How to replace words in file?

Hi Guys, I have a text where we used Ram in 10 times now I want replace all Ram words by Shyam word then how to do it. (6 Replies)
Discussion started by: aaditya321
6 Replies

9. Shell Programming and Scripting

How to replace some specific words from file?

I have the file like this. cat 123.txt <p> <table border='1' width='90%' align='center' summary='Script output'> <tr><td>text </td> </tr> </table> </p> I want to replace some tags and want the output like below. I tried with awk & sed commands. But no luck. Could someone help me on this? ... (4 Replies)
Discussion started by: thomasraj87
4 Replies

10. Shell Programming and Scripting

Replace particular words in file based on if finds another words in that line

Hi All, I need one help to replace particular words in file based on if finds another words in that file . i.e. my self is peter@king. i am staying at north sydney. we all are peter@king. How to replace peter to sham if it finds @king in any line of that file. Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
shishi_as_rep_process(3)					      shishi						  shishi_as_rep_process(3)

NAME
shishi_as_rep_process - API function SYNOPSIS
#include <shishi.h> int shishi_as_rep_process(Shishi_as * as, Shishi_key * key, const char * password); ARGUMENTS
Shishi_as * as structure that holds information about AS exchange Shishi_key * key user's key, used to encrypt the encrypted part of the AS-REP. const char * password user's password, used if key is NULL. DESCRIPTION
Process new AS-REP and set ticket. The key is used to decrypt the AP-REP. If both key and password is NULL, the user is queried for it. RETURN VALUE
Returns SHISHI_OK iff successful. REPORTING BUGS
Report bugs to <bug-shishi@gnu.org>. COPYRIGHT
Copyright (C) 2002-2010 Simon Josefsson. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. SEE ALSO
The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command info shishi should give you access to the complete manual. shishi 1.0.1 shishi_as_rep_process(3)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy