I'm trying to do a bedtools compare on a couple of bed files. One of the bed files keeps throwing this error:

    Error: unable to open file or unable to determine types for file

My file is as follows:

```
chr1     810865      3198369
chr1     844270      845356
chr1     882432      10373009
chr1     1104962     1173985
chr1     2616309     2617058
chr1     3056425     3245459
chr1     4704545     5447621
```

I have checked that the start position is before the end position. I have added and removed column headings chrom, "start" and "end" (also tried 'chromStart' and 'chromEnd'. But no joy. I had originally created this bed file from a tab delimited file from R. Does anyone know what has gone wrong?
OK so this is what I did in case anyone else gets the same problem

1. As per Ashutosh I ran `perl -p -i -e 's/ /\t/g'` I think this was not the problem though in the end but is probably a good idea
2. Uploaded the bed file to UCSC genome browser as a custom track. If the bed file is incorrectly formatted it will tell you what the problem is and is much better at debugging than bedtools
3. beware of directory paths when running the command line.

Sorted now

Thanks everyone