Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

awk extract one file from another file

awk 'NR==FNR{huty[$1]=$2;next}NR>FNR{if($1 in huty){print $0 "	" huty[$1]} else {print $0 "	" "None"}}' input1.txt input2.txt > output.txt

cat output.txt
北京    beijing
上海    shanghai
广州    guangzhou
南京    None
Comment

PREVIOUS NEXT
Code Example
Python :: get all methods of an instance 
Python :: with open("[Followed][{}]".format(self.username), "a+") as flist: 
Python :: updating to database 
Python :: polycarp and coins codeforces solution 
Python :: filtrar en python/how to filter in python 
Python :: multiple delimiters pandas 
Python :: Form rendering options in django 
Python :: fastapi authentication 
Python :: invalid literal for int() with base 10 python 
Python :: python seperate int into digit array 
Python :: check if set is a subset of another python 
Python :: how to add an symbol to a certain part of a list python 
Python :: divisibility by 13 in python 
Python :: > not supported between tuple and int 
Python :: how to simulate a keypress using pyautogui 
Python :: python 3 download 
Python :: python access class property from string 
Python :: get dataframe deminsions 
Python :: square root in python numpy 
Python :: use dict to replace missing values pandas 
Python :: print same index and value on each iteration of the for loop in Python 
Python :: Simple Python Permutation Passing argument as the second parameter 
Python :: en python quand on utilise = et== 
Python :: sys exit out of loop 
Python :: vortex identification 
Python :: dataframe ggplot rownames order 
Python :: Python NumPy atleast_3d Function Example 
Python :: with statement in python 
Python :: Python NumPy concatenate Function Example when axis equal to none 
Python :: Python NumPy vsplit Function Syntax 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =