ed Questions

7

Solved

I have a huge text file (~1.5GB) with numerous lines ending with ".Ends". I need a linux oneliner (perl\ awk\ sed) to find the last place '.Ends' appear in the file and add a couple of li...
Bohon asked 19/11, 2022 at 20:45

3

Solved

Need some unix shell basic here: For command that I see no "-" target in , say ed: print '%-2p\nq' | ed -s FILE Can I provide a stream from stdout of some cmd, rather than FILE name, as the dat...
Foretopmast asked 17/10, 2012 at 8:50

4

Solved

I have several text files with different row numbers and I have to delete in all of them the third-to-last line . Here is a sample file: bear horse window potato berry cup Expected result for this...
Collision asked 24/9, 2020 at 12:29

3

Solved

Suppose I have opened a text file in ed, and the current line looks like this: This is sentence one. Here starts another one. Now I want to put a newline after one. , such that the new sentence ...
Durer asked 12/8, 2017 at 19:23

3

Solved

I want to replace a single line in a file with multiple lines, e.g., I want to replace a particular function call, say, foo(1,2) with if (a > 1) { foo(1,2) } else { bar(1,2) } How c...
Chris asked 14/5, 2012 at 1:27

2

I need your help on the Namespaces for XMLStarlet. (never saw a library that badly explained) I have an XML file like: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ncx PUBLIC "-//NISO...
Clydesdale asked 20/6, 2013 at 11:46

2

I'm studying the ed text editor. To exit from input mode, a user should enter a line a single period (.). Let's say I want to enter the period as text. I thought of a workaround: first, I insert...
Peeler asked 26/10, 2013 at 15:10
1

© 2022 - 2024 — McMap. All rights reserved.