You are not logged in.
Hi all,
I have a favour to ask.. I need the following to make my life easier when I enter a gazillion of grades
for tutorials and tests of my students.
I need a script that deletes every line from a text file, if both of these hold:
1) The line does not end with a dash ( - )
2) The line is not the first one.
Then I need a second script that deletes every line that ends with a dash.
I'll be honest with you, I haven't tried to find out how to do it.. At this point my priority is to submit those grades faster, not to learn sed,
so I'm asking it as a favour, in case anybody has a couple of one-liners on the top of their heads.
Thank you in advance.
Last edited by geo909 (2014-09-27 00:08:40)
Offline
2) The life is not the first one.
Dag nab it, I could've have fun with that one.
in case anybody has a couple of one-liners on the top of their heads.
We can always come up with one-liners.
So what a sed/awk sort of thing?
I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.
Offline
sed '1b; /-$/!d' filesed '/-$/d' fileThis silver ladybug at line 28...
Offline
geo909 wrote:2) The life is not the first one.
Dag nab it, I could've have fun with that one.
Hahaha, yeah, that's a pretty spiritual script I was looking for!
sed '1b; /-$/!d' file sed '/-$/d' file
That's exactly what I needed. Thanks, you saved lots of my time!
Offline