I have two questions that are related, so it would be great if you can help me with both!
Question1:
I have a file A that looks like this:
I want to get something like:
Given that a,b,c has no spaces. But the other letters might contain spaces.
Question2:
Next, I have a file B that has
And I want to compare it with subset of file A:
So that I count how many lines of B are subset of A. In this case it is 2.
Hi,
having two csv files, both sorted, by key (column1), f1 containing duplicate keys and f2 containing no duplicate keys, how can I obtain all rows from f1 with the keys listed in file2? Example:
f1 is:
k1,gsj01fd
k2,vi982cj
k2,1fjk01e
k3,81kjfds
k4,sd9dasi
f2 is:
k2
k3
and I... (3 Replies)
Hi guyz I have been using this script to find similar keys in 2 files and merge the keys along with their values. Therefore it prints similar keys by leaving dissimilar. Any one knows how to print only Dissimilar leaving Similar.
Help would be appreciated.
The script I'm using for similar... (4 Replies)
HI
The input 1st column has specific keys like 1 with value a,b and c. 2 with b,b,d and 3 with a,a a.
when ever c appears as one of the values the result will be key ........ c (You can see in the out put as 1 w...... 6.... c) and same follows for d.
Thanx:)
I'm learning awk scripting. If... (3 Replies)
Hi Guyz
The 1st column of the input file has repeated keys like x,y and z.
The ist task is if the 1st column has unique key (say x) and then need to consider 4th column, if it is + symbol then subtract 2nd column value with 3rd column value (we will get 2(10-8)) or if it is - symbol subtract 3rd... (3 Replies)
key pair is 1st and 6th column ex:a20 : p10 or a20 : p11
For every key pair if the vlaue(4th column) is the same then delete all the lines who has keypair and the value
ex: a20 : p10 has value 1 only then delete those but a20 : p11 has different values 1,2 and 3 and keep those.
input
a20 ... (8 Replies)
I am trying to insert csv data into a table
mysql> load data infile '/var/www/PLU.csv' into table Food2 fields terminated by ',' enclosed by '"' lines terminated by '\n' ;
ERROR 1062 (23000): Duplicate entry '4014' for key 'PRIMARY'
... (4 Replies)
Hello experts, I want to join a file with files whosE names are mentioned in one of the columns of the same file.
File 1
t1,a,b,file number 1
t1,a,c,file number 1
t2,c,d,file number 2
t2,c,e,file number 2
t2,c,f,file number 2
t2,c,g,file number 2
t3,e,f,file number 3
file number 1... (3 Replies)
Dear folks
I have a map file of around 54K lines and some of the values in the second column have the same value and I want to find them and delete all of the same values. I looked over duplicate commands but my case is not to keep one of the duplicate values. I want to remove all of the same... (4 Replies)
Hello
I have a file like this:
> cat examplefile
ghi|NN603762|eee
mno|NN607265|ttt
pqr|NN613879|yyy
stu|NN615002|uuu
jkl|NN607265|rrr
vwx|NN615002|iii
yzA|NN618555|ooo
def|NN190486|www
BCD|NN628717|ppp
abc|NN190486|qqq
EFG|NN628717|aaa
HIJ|NN628717|sss
>
I can sort the file by... (5 Replies)
Hello,
I am writing a script which expects as its input a hash with student names as the keys and marks as the values. The script then returns array of average marks for student scored 60-70, 70-80, and over 90.
Output expected
50-70 1
70-90 3
over 90 0
The test script so far... (4 Replies)