[root@test]# cat input a,b,c,d [root@test]# cat input | sed 's/','/\n/g' a b c d [root@test]# cat input | awk '$1=$1' RS=, OFS="\n" a b c d [root@test]# cat input | tr -s ',' '\n' a b c d
Enjoy ๐
[root@test]# cat input a,b,c,d [root@test]# cat input | sed 's/','/\n/g' a b c d [root@test]# cat input | awk '$1=$1' RS=, OFS="\n" a b c d [root@test]# cat input | tr -s ',' '\n' a b c d
Enjoy ๐
Here I’m talking about a cool Python module using that you can compare two sheets in an excel sheet for a common value and merge the sheets.
First you need to install the module “pandas” for the solution. Python script is as below :
import pandas as pd source1_df = pd.read_excel('a.xlsx', sheetname='Sheet1') source2_df = pd.read_excel('a.xlsx', sheetname='Sheet2') joined_df = pd.merge(source1_df,source2_df,on='Serial',how='outer') joined_df.to_excel('result.xlsx')
Note : replace the sheet1 and sheet2 with actual name of the pages and use the correct primary key name(Here “Serial”; case sensitive)
Eg :
sheet1 as below
Serial | Hostname |
123 | abc |
234 | bcd |
345 | cde |
sheet2 as below
Serial | Model |
234 | Sparc |
345 | IBM |
567 | HP |
After executing the python script, output comesย as below :
Serial | Hostname | Model | |
0 | 123 | abc | |
1 | 234 | bcd | Sparc |
2 | 345 | cde | IBM |
3 | 567 | HP |
ENjoy ๐
Everyone know how to copy and paste characters in putty terminal using mouse (in case you don’t know, selecting the characters using mouse automatically copies and right click paste it) but less people know that it is possible with keyboard as well. You can use the below command to paste the characters into putty terminal
SHIFT + INS
Enjoy ๐