1

I am handling a rather large dataset. I have 238 files, for whcih I would like to import their content into excel. In order to do so, I am creating a combined txt file using

cat *.pdb > pdb_all.txt

When I count the lines (using wc -l) in the pdb_all.txt file, it contains only 236 lines. Can anyone tell me, if the cat command will delete duplicates automatically? If so, I'd very much like to keep both in the correct order. If not, what can have happend in during the cat command that results in two files less?

  • 3
    What does wc -l *.pdb say? cat doesn't remove duplicate lines. – muru Mar 9 '15 at 20:39
  • 3
    Usual suspect here: is there some file without a end-of-line character at the end? Or some empty file? – Rmano Mar 9 '15 at 20:41
  • I tried the wc -l *pdb and it showed me that two files were empty. I didn't know that was possible. But quite smart :) Thanks to both of you! – Ditte Mar 9 '15 at 20:44
  • pdb you say.. are you working with chemists and or VMD? If you are, there are tools to do that, which work quite well. where I am assuming pdb files are protein databases... – j0h Mar 24 '15 at 4:00
0

The answer was already given by the OP himself:

I tried the wc -l *pdb and it showed me that two files were empty. I didn't know that was possible. But quite smart :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.