Questions tagged [comm]

Comm is a UNIX utility used to compare two sorted files line by line. (For COMM ports, use tag "serial-port")

137 questions
0
votes
0 answers

How to Assign the Output of comm Command To Variable

I need assign the Output of comm Command to variable. I use comm to campare two list of values. These two lists are defined as: DATA_REF_DATA_OPIT_SIP='PCSCF4A PCSCF4B PCSCF5A PCSCF5B' DataExist='PCSCF4B PCSCF5A PCSCF5B' And when i do comm -23…
user6223604
0
votes
1 answer

Finding common lines in two files that have some blank lines

I got two almost identical files, same amount of lines and it's a code. I'm trying to create a file of the common lines between these two files and also have blank lines where the lines are different. I tried using comm, and it works good but…
lyoko
  • 429
  • 3
  • 4
0
votes
1 answer

Delete multiple files based on partial names list

I have a folder one my Red Hat server with approx. 500k files from various extensions. The name convention for those files is based on a number, for example: a123456.csv z123456.jpg 123456.exe a234.jpg 234.exe I designed a query which produce a…
OTG
  • 1
0
votes
2 answers

Compare two files and get the matching line result from 2nd file

I have two files , $cat file_1.txt 95335df46cfdb345c0214296e0043c00,NA a0af947a85e6895dab70eaec136cfed2,NA $cat file_2.txt 77f673137c17b4b0405d13060e9715a3,5,X,Y 874d51610c15975c82c081aba0b096c3,5,A,M 95335df46cfdb345c0214296e0043c00,5,M,N I'm…
Arun
  • 1,160
  • 3
  • 17
  • 33
0
votes
1 answer

Compare 2 text files and output lines unique in only 1 file while ignoring case

I have 2 large text files file1.txt and file2.txt Each file contains a line separated list of names e.g. file1.txt Beth james James paul Paul sally file2.txt James Paul Sally I want to produce a file containing names unique ONLY to file1.txt while…
bullhorn
  • 3
  • 1
0
votes
1 answer

How to print lines in one file that do not match lines in another *after transformation*

Please note, i understand how to output lines in one file that are not in another (here), my question is a little different. In one file i have lines akin to Андреев Барбашев Иванов ... in a different file there are…
v010dya
  • 5,296
  • 7
  • 28
  • 48
0
votes
1 answer

How to access additional file streams of the unix shell in Python?

How can I access the additional file streams like the comm command in Python? comm -23 <(sort -n Asub|uniq) <(sort -n A|uniq) I know that I can access stdin via sys.stdin, but how to access the other input stream?
guettli
  • 25,042
  • 81
  • 346
  • 663
0
votes
2 answers

Unix - Want records from file 2 that are not in file 1 by matching on the first 91 characters

I want to compare file2 to file1 by matching in the first 91 characters of each file and output the full record from file2 to file3. I'm new to Unix commands and just cant seem to figure this out. Thanks in advance, Jeff
0
votes
2 answers

bash compare the contents of two files and based on the results do two different actions

Cannot use diff and cannot use cmp. We are able to use comm with success, but I am not getting the correct results when used with a conditional in script. #!/bin/bash # http://stackoverflow.com/a/14500821/175063 comm -23 <(sort…
Leptonator
  • 3,379
  • 2
  • 38
  • 51
0
votes
1 answer

Linux Comm on Windows - Output should be Zero

The last days i did a lot of things with comm on Windows Batch to compare textfiles which each other. So normaly there is nothing i could do wrong. In my other projects the code below is working fine but not in the actual case and i can't see any…
Deex
  • 317
  • 2
  • 13
0
votes
1 answer

newline character in comm perl script

There is a newline character getting inserted between the 2 filenames. How do I avoid this? $diff = `comm -3 "/tmp/${PATH1U}_${SITE1}_s_${USER} /tmp/${PATH2U}_${SITE2}_s_${USER}"|wc -l`; This is the error message while executing: comm: missing…
Glad
  • 321
  • 1
  • 4
  • 7
0
votes
2 answers

Linux: Comparing two files but not caring what line only content

I am trying to use comm or diff Linux commands to compare to different files. Each file has a list of volume names. File A has 1500 volumes and file B has those same 1500 volumes plus another 200 with a total of 1700. I am looking for away to just…
aznjonn
  • 113
  • 16
0
votes
3 answers

Bash script using COMM and SORT issues syntax error near unexpected token

Linux, CentOS - to compare 2 files I use command comm --check-order -1 --output-delimiter=----- result.txt ; and it works on shell, but when I try create a bash file - I have syntax error near unexpected token…
Serge
  • 679
  • 1
  • 9
  • 23
0
votes
1 answer

Compare File Against Last Modified File, Output Mods to .TXT File

I have a requirement to create a batch file in windows 2003 server. We do have Cygwin installed so have the ability to run unix commands. Every night, a process will download a timestamped file, FILE*%yyyy%%mm%%dd%.txt to c:\temp\download. An FTP…
ID10T
  • 25
  • 2
  • 11
0
votes
1 answer

Using spark-kernel comm API

I started using spark-kernel recently. As given in tutorial and sample code, I was able to set up client and use it for executing code snippets on spark-kernel and retrieving back results as given in this example code. Now, I need to use comm API…