Timeline for Is there a faster way to remove a line (given a line number) from a file?
Current License: CC BY-SA 3.0
23 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 19, 2023 at 10:04 | answer | added | jubilatious1 | timeline score: 1 | |
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot |
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
|
|
| Mar 19, 2017 at 12:29 | answer | added | Jadzia | timeline score: 1 | |
| Apr 17, 2016 at 6:30 | answer | added | Zombo | timeline score: 1 | |
| Oct 2, 2015 at 14:26 | answer | added | schily | timeline score: -1 | |
| Sep 21, 2014 at 17:07 | answer | added | abligh | timeline score: 0 | |
| Mar 4, 2013 at 17:58 | answer | added | alexis | timeline score: 7 | |
| Mar 4, 2013 at 17:51 | comment | added | alexis |
sed reads through the data once. With head|tail the whole data stream must be copied twice (once by each process).
|
|
| Mar 4, 2013 at 2:09 | vote | accept | LasEspuelas | ||
| Mar 4, 2013 at 0:37 | comment | added | LasEspuelas | @manatwork it takes approximately double the time than sed with the head|tail combination for me. Unless I am doing the timings wrong. | |
| Mar 4, 2013 at 0:32 | answer | added | Gilles 'SO- stop being evil' | timeline score: 1 | |
| Mar 3, 2013 at 20:46 | comment | added | Kevin | Some stats on the opposite (extracting lines from the middle) suggest sed will be your best bet. | |
| Mar 3, 2013 at 19:42 | answer | added | Stéphane Chazelas | timeline score: 13 | |
| Mar 3, 2013 at 19:13 | answer | added | Joseph R. | timeline score: 1 | |
| Mar 3, 2013 at 18:46 | answer | added | vonbrand | timeline score: 1 | |
| Mar 3, 2013 at 18:41 | comment | added | vonbrand | @manatwork, I believe the processing is mostly inconsequential against reading/writing 50GiB... | |
| Mar 3, 2013 at 18:40 | comment | added | vonbrand | @jordanm, it definitely is much slower (it has to gulp down the whole file, and set up the data structures it uses to represent the file in memory). | |
| Mar 3, 2013 at 17:38 | comment | added | manatwork |
Somehow uglier, but may perform better: head -$((linenum1-1)) input.txt > input.temp; tail -n +$((linenum2+1)) input.txt >> input.temp.
|
|
| Mar 3, 2013 at 17:10 | review | First posts | |||
| Mar 3, 2013 at 17:23 | |||||
| Mar 3, 2013 at 17:02 | answer | added | watael | timeline score: -1 | |
| Mar 3, 2013 at 17:01 | comment | added | jordanm |
the ed line editor may be faster.
|
|
| Mar 3, 2013 at 16:59 | history | edited | LasEspuelas | CC BY-SA 3.0 |
added a related question
|
| Mar 3, 2013 at 16:53 | history | asked | LasEspuelas | CC BY-SA 3.0 |