compare

awk search column from one file, if match print columns from both files

孤街醉人 提交于 2019-11-30 21:04:33
I'm trying to compare column 1 from file1 and column 3 from file 2, if they match then print the first column from file1 and the two first columns from file2. here's a sample from each file: file1 Cre01.g000100 Cre01.g000500 Cre01.g000650 file2 chromosome_1 71569 |655|Cre01.g000500|protein_coding|CODING|PAC:26902937|1|1) chromosome_1 93952 |765|Cre01.g000650|protein_coding|CODING|PAC:26903448|11|1) chromosome_1 99034 |1027|Cre01.g000100 |protein_coding|CODING|PAC:26903318|9|1) desired output Cre01.g000100 chromosome_1 99034 Cre01.g000500 chromosome_1 71569 Cre01.g000650 chromosome_1 93952 I've

Compare images to find differences

眉间皱痕 提交于 2019-11-30 19:37:50
Task: I have a camera mounted on the end of our assembly line, which captures images of produced items. Let's for example say, that we produce tickets (with some text and pictures on them). So every produced ticket is photographed and saved to disk as image. Now I would like to check these saved images for anomalies (i.e. compare them to an image (a template), which is OK). So if there is a problem with a ticket on our assembly line (missing picture, a stain,...), my application should find it (because its image differs too much from my template). Question: What is the easiest way to compare

C comparing pointers (with chars)

↘锁芯ラ 提交于 2019-11-30 18:31:33
Good evening, I have 2 functions and each of them accepts as argument a pointer to char: char pointer[255]; func1(char* pointer) { ... memcpy(pointer,some_char,strlen(something)); return; } func2(char* pointer) { ... if (pointer==someother_char) exit(0); //FAILs //also I have if(pointer==someother_pointer2char); // FAILs } Now I've tried strstr,strcmp etc... doesn't work. Wanted to try memcmp but I don't have static len. As I have to compare char* to char and char* to char* I would be needing two solutions right? So, how to compare these pointers (actually pointees) in shortest possible way?

how to compare two string arrays without java utils

↘锁芯ラ 提交于 2019-11-30 18:10:35
问题 Check to see if the array arr1 contain the same elements as arr2 in the same order in java. for example: isTheSame({"1", "2", "3"}, {"1", "2", "3"}) → true isTheSame({"1", "2", "3"}, {"2", "1", "1"}) → false isTheSame({"1", "2", "3"}, {"3", "1", "2"}) → false so far i have public boolean isTheSame(String[] arr1, String[] arr2) { if (arr1.length == arr2.length) { for (int i = 0; i < arr1.length; i++) { if (arr1[i] == arr2[i]) { return true; } } } return false; } The problem with this is that

How to check for null value in NSNumber

空扰寡人 提交于 2019-11-30 17:14:27
问题 First off I confess my ignorance, I've learned everything I know about Objective-C in the few months I've been working on my project. I also find it utterly frustrating how Objective-C seems to complicate what would be simple matters in any other language I've worked with. This question is a case in point... In the first run my app downloads a bunch of JSON which it uses to populate a CoreData store. I use an Obj-C/JSON library (CJSONDeserializer) to convert the JSON to NSArrays. In the JSON

Perl: Compare Two CSV Files and Print out differences

给你一囗甜甜゛ 提交于 2019-11-30 17:07:34
I'm a noob in Perl and I'm having a tough time getting this done. I have two single-columned CSV files, and I'm trying to print the differences to a third file. File1: 123 124 125 126 File2: 123 124 127 Expected Output: 125 126 127 This is what I've got so far, which isn't working: #!/usr/bin/perl use strict; use warnings; my $sheet_1; my $sheet_2; my $count1 = 0; my $count2 = 0; my $file1 = 'file1.csv'; my $file2 = 'file2.csv'; my $file_out = 'output.csv'; open (FILE1, "<$file1") or die "Couldn't open input file: $!"; open (FILE2, "<$file2") or die "Couldn't open input file: $!"; while(

Find value from one csv in another one (like vlookup) in bash (Linux)

∥☆過路亽.° 提交于 2019-11-30 16:38:15
I have already tried all options that I found online to solve my issue but without good result. Basically I have two csv files (pipe separated): file1.csv: 123|21|0452|IE|IE|1|MAYOBAN|BRIN|OFFICE|STREET|MAIN STREET|MAYOBAN| 123|21|0453|IE|IE|1|CORKKIN|ROBERT|SURNAME|CORK|APTS|CORKKIN| 123|21|0452|IE|IE|1|CORKCOR|NAME|HARRINGTON|DUBLIN|STREET|CORKCOR| file2.csv: MAYOBAN|BANGOR|2400 MAYOBEL|BELLAVARY|2400 CORKKIN|KINSALE|2200 CORKCOR|CORK|2200 DUBLD11|DUBLIN 11|2100 I need a linux bash script to find the value of pos.3 from file2 based on the content of pos7 in file1. Example: file1, line1, pos

how to compare two strings in javascript if condition

我与影子孤独终老i 提交于 2019-11-30 16:08:08
问题 I'm having trouble recalling how to compare these two strings in an if statement. What I'm string to do is check if my variable compare equals page1 or page2 if not, go to the else statement. var compare = "page3"; if (compare === "page1" || "page2") { document.body.innerHTML = "github url"; } else { document.body.innerHTML = "non-github url"; } 回答1: You could check every option. if (compare === "page1" || compare === "page2") { Or you could use an array and check with an existential

软件-工具:Beyond Compare

╄→гoц情女王★ 提交于 2019-11-30 15:47:00
ylbtech-软件-工具:Beyond Compare 1. 返回顶部 1、 Beyond Compare是一套由Scooter Software推出的文件比较工具。主要用途是 对比两个文件夹或者文件,并将差异以颜色标示 。比较范围包括 目录,文档内容 等。 软件名称:Beyond Compare 开发商:Scooter Software 软件平台:Windows、Mac OS X 软件版本:Beyond Compare 4 软件语言:简体中文 软件授权:收费 目录 1 简介 2 系统要求 3 功 能 简介 Beyond Compare是一套由Scooter Software推出的软件,主要用途比较多。Beyond Compare可以比较的内容有以下这三种: 电脑上 两个目录的内容 , 电脑上的 目录和FTP地址的内容 两个文本档案的内容(包括 UTF-8、html、Delphi源程序等文本档案) 。 因为这些功能,Beyond Compare被应用于 版本控制及资料同步 的工作上。 Beyond Compare有内建的HTML档案浏览器,还有支援压缩包的功能。这些特别的功能,可以让用户作跨媒体之间的比较,例如:把现时网站的内容与一个储存在光碟上的压缩备份档案作比较。现时Beyond Compare的最新版本是3.3.7 版,于2013年3月推出(2014-12-09最新版本版本

Compare two sheets using arrays

牧云@^-^@ 提交于 2019-11-30 15:44:04
问题 My code is super slow (10+ min for each sheet) due to the quantity of data i have. I believe there may be a way to speed it up using arrays, but i am not sure how to go about it. I will try to explain the situation in detail. I have two worksheets with invoice#s, part#s and sale prices (among other info) that I am trying to compare to find differences. I've created a unique number for each line of data using a concatenation of the invoice# and the part# on both sheets. I've also sorted both