Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
    Tweeted twitter.com/StackUnix/status/1076764356849876992
5 added 335 characters in body
source | link

Resolution: the files were saved with CR rather than LF line breaks. Mosvy pointed this out, but only posted as a comment, rather than an answer, so I am unable to officially thank him for helping me to find the cause and solve the problem.

Thanks mosvy, if you come back please post as an answer so I can give you a thumbs up.

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does not delete lines 3 - 10; it just spits back the entire file to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

** Update 2:

Thank you to mosvy!! I wish I could upvote your comment. It was the problem solver.

It turns out the file was saved with CR rather than LF line breaks

When I converted it, that cured everything.

Thanks to everyone who contributed.

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does not delete lines 3 - 10; it just spits back the entire file to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

** Update 2:

Thank you to mosvy!! I wish I could upvote your comment. It was the problem solver.

It turns out the file was saved with CR rather than LF line breaks

When I converted it, that cured everything.

Thanks to everyone who contributed.

Resolution: the files were saved with CR rather than LF line breaks. Mosvy pointed this out, but only posted as a comment, rather than an answer, so I am unable to officially thank him for helping me to find the cause and solve the problem.

Thanks mosvy, if you come back please post as an answer so I can give you a thumbs up.

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does not delete lines 3 - 10; it just spits back the entire file to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

** Update 2:

Thank you to mosvy!! I wish I could upvote your comment. It was the problem solver.

It turns out the file was saved with CR rather than LF line breaks

When I converted it, that cured everything.

Thanks to everyone who contributed.

4 added 260 characters in body
source | link

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does not delete lines 3 - 10; it just spits back the entire file to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

** Update 2:

Thank you to mosvy!! I wish I could upvote your comment. It was the problem solver.

It turns out the file was saved with CR rather than LF line breaks

When I converted it, that cured everything.

Thanks to everyone who contributed.

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does not delete lines 3 - 10; it just spits back the entire file to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does not delete lines 3 - 10; it just spits back the entire file to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

** Update 2:

Thank you to mosvy!! I wish I could upvote your comment. It was the problem solver.

It turns out the file was saved with CR rather than LF line breaks

When I converted it, that cured everything.

Thanks to everyone who contributed.

3 added 260 characters in body
source | link

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does nonot delete lines 3 - 10; it just spits back the entire file output;to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does no delete lines 3 - 10; it just spits back the entire file output;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

SED seems to have:

sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt

(delete line 3-10, then delete from line containing "<ACROSS>" to end of file; then write out output.)

Even when I try with only:

sed '3,10d' input.txt > output.txt

but for some reason neither seems to work on my Mac.

Not sure what else to try.

I am hoping there is something very similar with AWK.

Update:

when I enter:

sed '3,10d' input.txt > output.txt

it does not delete lines 3 - 10; it just spits back the entire file to output.txt;

when I try:

sed '/<ACROSS>/,$d' input.txt > output.txt

output.txt is blank

Also, I'm on 10.9.4

2 added 260 characters in body
source | link
1
source | link