Search Results

Search: Posts Made By: dr_sabz
3,705
Posted By dr_sabz
Several file comparison not uniq or comm command
When comparing several files is there a way to find values unique to each file?

File1

a
b
c
d


File2

a
b
t


File 3

a
2,298
Posted By dr_sabz
Duplicate columns and lines
Hi all,

I have a tab-delimited file and want to remove identical lines, i.e. all of line 1,2,4 because the columns are the same as the columns in other lines. Any input is appreciated.

abc ...
1,699
Posted By dr_sabz
calculation on a large file
Trying to do some simple maths on a large file. Excel works fine but I have 1 million entries:

If the difference between a number in column 2 and the one above it is more than 100 the insert a...
4,899
Posted By dr_sabz
Yes that helps, cheers. I have also downloaded...
Yes that helps, cheers. I have also downloaded the gawk.pdf :)
4,899
Posted By dr_sabz
Perfect..Thankyou for your help :b:. I still...
Perfect..Thankyou for your help :b:. I still have a lot to learn :)
4,899
Posted By dr_sabz
Thankyou to both of you. Both work well..but I...
Thankyou to both of you. Both work well..but I would like to take a minute to understand the code

awk '(getline f2 < F2) > 0 {
split(f2, t) # you split the columns in File 2? t means tab...
4,899
Posted By dr_sabz
Basically, we would would be doing this...
Basically, we would would be doing this conditional check for each line in file2 against each line in file1. I have something like this:

awk -F, '\
BEGIN {
while ((getline < "file2") > 0)...
4,899
Posted By dr_sabz
You are correct in the code above... and...
You are correct in the code above...

and because of the second false condition, we would print nothing and move onto the second line in file2, where 38>=30 (true) AND 41<=44 (true) hence here we...
4,899
Posted By dr_sabz
radoulov, The paste command simply joins the...
radoulov,

The paste command simply joins the two columns together. I dont see how it can help with the query I have. Secondly, no this is not a homework assignment. I am post doctoral...
3,406
Posted By dr_sabz
Hi cfajohnson, Not line for line. The files...
Hi cfajohnson,

Not line for line. The files are also not the same length
File 1 is tab delimited:
10 8
30 44
50 59
94 96

File 2 is:
25 29
38 41
49 54

So the code should "for...
3,406
Posted By dr_sabz
conditional statement
Hi all,

The following code is to find if a list of numbers from one file are within the range in another file.

awk -F, '\
BEGIN {
while ((getline < "file2") > 0)
file2[$2]=$3
}
{for...
4,899
Posted By dr_sabz
Thanx for your reply radoulov's, but your method...
Thanx for your reply radoulov's, but your method doesnt relate to my question!
Is anyone else able to help?
Cheers
50,791
Posted By dr_sabz
cat -n inputfile > result
cat -n inputfile > result
4,899
Posted By dr_sabz
Sorry the tab didnt show well File 1 is: 10 8...
Sorry the tab didnt show well
File 1 is:
10 8
30 44
50 59
94 96
98 120

File2 is
25 29
38 41
49 54
4,899
Posted By dr_sabz
For loop using 2 files
Hi all,

Can anyone shed any light on the following problem?

I have 2 columns in File1:
10 8
30 44 ...
3,210
Posted By dr_sabz
Thankyou Gayucvns :b: I know != is not equal...
Thankyou Gayucvns :b:
I know != is not equal to. If I want to put an "or" condition instead of an && would you know the command? :)

Layla
3,210
Posted By dr_sabz
2 or more if conditions
Hello,

I have a file as follows:

col no:1 2 3 4 5 6 7 8 9 10 11

a 4 226 226 ch:95024048-95027592, 1y224 of 3545 ...
3,422
Posted By dr_sabz
Thankyou Spirtle, Your second command also...
Thankyou Spirtle,
Your second command also worked well:).
I used vgersh's method to my advantage as follows:

awk -F'happy' 'NF==1' file > outfile1 #for no occurances
awk -F'happy' 'NF==2'...
3,422
Posted By dr_sabz
Thankyou for your help vgersh :b:. It must be...
Thankyou for your help vgersh :b:. It must be great to know everything :rolleyes: As you can guess I am still in the learning phase.
3,422
Posted By dr_sabz
sorry "threw" not "through" :eek: ...its...
sorry "threw" not "through" :eek: ...its late..:rolleyes:!
3,422
Posted By dr_sabz
Thank you Jim, :b: can I pull out the line...
Thank you Jim, :b: can I pull out the line numbers that have been deleted using -n in the code? I tried the comm command but for 3 million entries it was too time consuming.

Unfortunately nawk...
3,422
Posted By dr_sabz
occurances
Hi,

Anyone know how to do the following? :eek:

I Have a file as follows:

happygoluckypeoplearenotalwayshappy
happyisawordthatisnotusedalot

If the word "happy" is present MORE than once...
2,606
Posted By dr_sabz
awk grep sed or something better
Hello all,

Can anyone help with the following? :)
I have file1 with 150,000 words in a list and file2 with 148,000 words in a list - all of which are in file1. I want to create a new file with...
2,462
Posted By dr_sabz
Oh my, of course. I guess I didnt fully...
Oh my, of course. I guess I didnt fully understand what I had done before. :o

Thankyou..it works fine.:b:
2,462
Posted By dr_sabz
removing characters
Hi all,

Any help on how to do the following? :eek:

I have an infile as follows:
_thisishowyouwritehelloworld
_thisisalsohowyouwritehelloworld2

I want to delete the characters from "_" to...
Showing results 1 to 25 of 32

 
All times are GMT -4. The time now is 07:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy