Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 6764  / 1 Year ago, tue, march 7, 2023, 12:52:55



I would like to know is it possible to copy line number 7,8,9 and 17,18 of one text file to another one?



Thanks much in advance!!!


More From » 12.04

 Answers
1

You can use sed (stream editor) to selectively print lines by number e.g.



sed -n '7,9p;17,18p' oldfile > newfile

[#29144] Wednesday, March 8, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
whipstder

Total Points: 189
Total Questions: 110
Total Answers: 99

Location: Uzbekistan
Member since Sat, Feb 27, 2021
3 Years ago
;