Search code examples
solariscomm

Value too large for defined data type in Comm command solaris


When I use comm command to compare the files with 2 GB and 1.7GB I got the following error. Value too large for defined data type

I tried the following command.

comm -23 file1.txt file2.txt

Solaris Generic_150401-32 i86pc

Kindly help


Solution

  • As Sathiyadasan writes, Solaris 10 comm can't handle large files (>2GB).

    I offer 3 options: 1) download the GNU version of comm and use that on solaris 10 2) move to Solaris 11 and use the /usr/gnu/bin/comm 3) write a more complicated script, depending on what you're trying to accomplish:

    Reducing your data might make the problem more manageable. If the files have lots of duplicate entries, this workds well. If you're trying to find lines that are unique to the first file, but don't care about the order of the lines within the file, you could use:

    sort -o file1.smaller -u file1.txt sort -o file2.smaller -u file2.txt comm -23 file1.smaller file2.smaller

    Really, how you handle this depends on the nature of your data and what you're trying to discover.

    Good luck!