Search Results

Search: Posts Made By: kingpeejay
10,162
Posted By kingpeejay
compare two files, selected columns only
hi! i have two files that looks like this

file 1:
ABS 123 456
BCDG 124 542
FGD 459 762

file 2:
ABS 132 456
FGD 459 762

output would be:

from file1:
ABS 132 456
BCDG 124 542

from...
2,117
Posted By kingpeejay
hi! what do you mean by $NF? thanks!
hi! what do you mean by $NF? thanks!
2,117
Posted By kingpeejay
grep a string and print strings on that line
i have a file like below


ABS 12234 A C 12G
CFY 23865 A C 34D

i want to grep "A C" then print

ABS 12G 12234
CFY 34D 23865

Thanks!
5,823
Posted By kingpeejay
Thanks! But is there a shorter code for this?
Thanks! But is there a shorter code for this?
5,823
Posted By kingpeejay
File 1 ADG | 234 | 345 ADG | 567 | 789 DJG...
File 1
ADG | 234 | 345
ADG | 567 | 789
DJG | 324 | 321
File 2
ADG | 235 | 345
ADG | 567 | 789
DJG | 324 | 320
Output:
"FROM FILE 1"
ADG | 234 | 345
DJG | 324 | 321
"FROM FILE 2"
ADG |...
5,823
Posted By kingpeejay
Compare selected columns from a file and print difference
I have learned file comparison from my previous post here. Then, it is comparing the whole line. Now, i have a new problem.
I have two files with 3 columns separated with a "|". What i want to do...
14,553
Posted By kingpeejay
hi all! i just want to ask fo rhelp...
hi all!

i just want to ask fo rhelp regarding this... the requirements is the same as the original problem stated. the only difference is that that the comparison is only on 2nd and third columns....
3,536
Posted By kingpeejay
i have this working file that i can't find all...
i have this working file that i can't find all the values i needed. so, what i want to do is to put that missing value before the first string of each line.
3,536
Posted By kingpeejay
for example: if the first string of a line is...
for example: if the first string of a line is "MALE", then insert a string like "AM" before it.
3,536
Posted By kingpeejay
@franklin: actually, it's not the first letter...
@franklin: actually, it's not the first letter that should be inserted. im sorry if i mislead you, it's just an example. Thanks!
3,536
Posted By kingpeejay
put a string before a searched string
hi all!

i have a working that looks like this...

file1
MALE JOHN
MALE ANJO
FEMALE ANNE
MALE JAMES
FEMALE HONEY
FEMALE IZA

what i want to do is insert "M" when...
2,665
Posted By kingpeejay
cmp file1 file2
cmp file1 file2
2,665
Posted By kingpeejay
diff file1 file2 i hope that will help
diff file1 file2

i hope that will help
3,537
Posted By kingpeejay
tnx a lot! ill give it a try!
tnx a lot! ill give it a try!
3,537
Posted By kingpeejay
if the dividend yields a value of "0", then the...
if the dividend yields a value of "0", then the answer should be "#NA#"

---------- Post updated at 04:35 PM ---------- Previous update was at 04:32 PM ----------

if((b+c) = "0")
{print b"...
3,537
Posted By kingpeejay
it's a part of an awk... i used awk to get the...
it's a part of an awk... i used awk to get the corresponding values for the variables a, b, c, d & e..
2,665
Posted By kingpeejay
try diff
try diff
3,537
Posted By kingpeejay
divided by 0 problem
Hi!

i have a new shell script that will compute for a value...


a = b/(b+c)
c = d/(d+e)
print b" "a" "d" "c


but there will be an instance that either b+c or d+e will be "0".... if...
2,920
Posted By kingpeejay
many thanks!
many thanks!
2,920
Posted By kingpeejay
hi! my output file should be: adg | beh...
hi!

my output file should be:

adg | beh
jmp | knq
twa | uxb

but when i use the code above:

paste -d"|" file1 file2 >outputfile

it yields:

adg|beh
jmp|knq
twa|uxb

there is no...
1,678
Posted By kingpeejay
paste - -? pls forgive my ignorance but what do...
paste - -? pls forgive my ignorance but what do you mean by "- -"

thanks!
1,678
Posted By kingpeejay
question on grep..
i have a question on grep

input file:

FIRST NAME :ANNE
LAST NAME :CRUZ
<text>
<text>
<text>
FIRST NAME :JOHN
LAST NAME :ALBA
<text>
<text>
<text>
FIRST NAME :IRMA
LAST NAME...
2,920
Posted By kingpeejay
Combine two files and put a "|" between
File 1
adg
jmp
twa

File 2
beh
knq
uxb

Output file
adg | beh
jmp | knq
twa | uxb

i tried paste file1 file 2 > outfile, but i don't know how to put "|" in between
2,995
Posted By kingpeejay
i have this kind of problem.... in my case, i...
i have this kind of problem.... in my case, i would like to combine two files and put "|" in between, and delete lines that starts with a specific string.., thanks!
3,717
Posted By kingpeejay
Compare two strings, and print lines containing mismatches
pls help me on this... and im really sorry because i really don't know where to start here...

FILE1

ABC DEF 10 2
DEF GHI 11 3
GHI JKL 12 5
JKL MNO 13 7
MNO PQR 14 5


requirements:...
Showing results 1 to 25 of 69

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