1

I have one .txt file which has more than 1 million record inside. (rownum from 1 to 1 million) I need to divide this file into two 500k files in linux. (file1 = rownum from 1 to 500k and file2 = rownum from 500k to 1 million).

How can I do it?

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Smdevfunia
  • 11
  • 1

1 Answers1

1

You are looking for the program split.

split -l 500000 file prefix
RalfFriedl
  • 8,816
  • 6
  • 23
  • 34