10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Long time listener first time poster. Hope someone can advise.
I have two files, 1000+ lines in each, two fields in each file.
After performing a sort, what is the best way to find exact matches where field $1 and $2 in file1 are also present in file2 on the same line, then output only those... (6 Replies)
Discussion started by: bstaff
6 Replies
2. UNIX for Beginners Questions & Answers
Hi,
I have 2 tab-delimited input files as follows.
file1.tab:
green A apple
red B apple
file2.tab:
apple - A;Z
Objective:
Return $1 of file1 if,
. $1 of file2 matches $3 of file1 and,
. any single element (separated by ";") in $3 of file2 is present in $2 of file1
In order to... (3 Replies)
Discussion started by: beca123456
3 Replies
3. Linux
Hi,
I am trying to merge two csv files based on matching criteria:
File description is as below :
Key_File :
000|ÇÞ|Key_HF|ÇÞ|Key_FName
001|ÇÞ|Key_11|ÇÞ|Sort_Key22|ÇÞ|Key_31
002|ÇÞ|Key_12|ÇÞ|Sort_Key23|ÇÞ|Key_32
003|ÇÞ|Key_13|ÇÞ|Sort_Key24|ÇÞ|Key_33
050|ÇÞ|Key_15|ÇÞ|Sort_Key25|ÇÞ|Key_34... (3 Replies)
Discussion started by: PK29
3 Replies
4. UNIX for Dummies Questions & Answers
Hello,
I'm back again looking for your precious help-
This time I need to merge two text files with matching two fields, output only common records with mixed output.
Let's look at the example:
FILE1
56153;AAA0708;3;TEST1TEST1;
89014;BBB0708;3;TEST2TEST2;
89014;BBB0708;4;TEST3TEST3;
... (7 Replies)
Discussion started by: emare
7 Replies
5. Shell Programming and Scripting
I have one script as below:
#!/bin/ksh
Outputfile1="/home/OutputFile1.xls"
Outputfile2="/home/OutputFile2.xls"
InputFile1="/home/InputFile1.sql"
InputFile2="/home/InputFile2.sql"
echo "Select hobby, class, subject, sports, rollNumber from Student_Table" >> InputFile1
echo "Select rollNumber... (3 Replies)
Discussion started by: Sharma331
3 Replies
6. Shell Programming and Scripting
Hello expert friends,
I'm writing a script to capture stats using sar and stuck up at report generation.
I have around 10 files in a directory and need to merge them all vertically based on the time value of first column (output file should have only one time value) and insert comma after... (6 Replies)
Discussion started by: prvnrk
6 Replies
7. Shell Programming and Scripting
Hi!
I need to merge two files when col1 (x:x:x) matching and adds second column from file1.txt.
# cat 1.txt
aaa;a12
bbb;b13
ccc;c33
ddd;d55
eee;e11
# cat 2.txt
bbb;b55;34444;d55
aaa;a15;35666;a44
I try with this awk and I get succesfully first column from 1.txt:
# awk -F";"... (2 Replies)
Discussion started by: fhluque
2 Replies
8. Shell Programming and Scripting
Hi,
I am working with two tab-delimited files with multiple columns, formatted as follows:
File 1:
>chrom 1 100 A G 20 …(10 columns)
>chrom 1 104 G C 18 …(10 columns)
>chrom 2 28 T C ... (4 Replies)
Discussion started by: mbp
4 Replies
9. Shell Programming and Scripting
I am newbie to unix and would please like some help to solve the task below
I have two files, file_a.text and file_b.text that I want to evaluate.
file_a.text
1698.74
1711.88
6576.25
899.41
3205.63
4187.98
697.35
1551.83 ... (3 Replies)
Discussion started by: gameli
3 Replies
10. Shell Programming and Scripting
Need some code tweak:
awk 'END {
for (i=1; i<=n; i++)
if (f2])
print f2]
}
NR == FNR {
f2 = $1] = $0
next
}
$1 in f2 {
delete f2
}1' FS=, OFS=, 2.csv 1.csv > 3.csvfile 1.csv have:
$1,$2,$3,$4,$5,$6,$7,$8,$9......
file 2.csv have:
$1,$2,$3,$4,$5,$6 (2 Replies)
Discussion started by: u10
2 Replies