Using sed in c-shell

March 31, 2009 at 22:59:37
Specs: Windows XP
Hi, trying to get the sed working, but im getting an error it cannot open the file. This is what im doing:

Replace line 1 with 'censored"
sed '1 c\\
censored' data1.txt

Enter == after line 1
sed 'a \\
== ' data1.txt

Each returns an error
sed: command garbled: a \

Can't open data1.txt

File has w and r permissions. Any idea? Thanks !

See More: Using sed in c-shell

Report •

March 31, 2009 at 23:08:45
show a sample of your file, and what you want to get out of it.

Report •

March 31, 2009 at 23:51:19
This is the file I have, and im basically just playing with it, practising 'sed' but i cannot figure out why it's not working, it doesnt return the intended results

"data1" 30 lines, 754 characters
This is a test file for you to work on. It contains
blank lines

and lines containing white space

which includes tabs and spaces. You will also find some
sentences with one space after the period. Other lines
will have two spaces. There are "quoted strings" as well
as 'single-quoted strings'.

Here is an example of text delimited by colon characters. It
is a list of classic literature, including author information,
a title and a year of publication.

Seuss:Dr.:Green Eggs and Ham:1960
Tolkien:J.R.R.:The Fellowship of the Ring:1954
Fitzgerald:F. Scott:The Great Gatsby:1925
Chin:Kenward:CISY 1213 Notes:2009

Finally, here are some lines


These lines will help you to figure out how to use whole line matching.


Report •

Related Solutions

Ask Question