In vi we can easily do this.
suppose if you want to copy entire file content to some other file then try this
open your original file then in the command line write this
:w file1
here your entire file content will be copied to file1
suppose if you want to copy only part of the file then try this
first enable line numbering using this command
:setnu
After that if you want to copy from line number 10 to 23 then write this command in the command line
:10,23w file2
This will copy the content from line number 10 to 23 to file2