I have a 300000 lines in a text file. And I have a file with list of line numbers that I need to extract from text file. Numbers are ordered. They are not ranges and there are about 4000 of them. So I need 4000 lines from source text file with specified ids.
Are there any efficient way to copy lines specified in a such file to a new file with unix console tools? Or any lightweight script?