11-06-2006
Thanks that worked great!
Is there any method of apply this to only the second line containing only '--#' and leaving the first line the same?
Thanks for your help!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I've got a problem with SED. It's my intention to shorten a file path (removing the file name) with the help of SED. Something like:
tmp\folder1\folder2\blah.txt has to be transformed to
tmp\folder1\folder2\.
I suppose, it's on the tip of my tongue. Perhaps it's close to:
sed... (2 Replies)
Discussion started by: sysadv
2 Replies
2. Shell Programming and Scripting
I am obviously missing something here, but the following simple command is giving me problems:
sed 'i\extratext' filename.txt
I receive "sed: command garbled: i\extratext' "
Any suggestions?
Thanks. (6 Replies)
Discussion started by: here2learn
6 Replies
3. UNIX for Dummies Questions & Answers
Hello. Just trying to write this line to an empty file. CAT shows nothing was written. Any suggestions or answers?
#!/bin/bash -x
THIS=FIRSTLINE
sed '1w '$THIS'' testfile
cat testfile
Thank you. (2 Replies)
Discussion started by: steveramsey
2 Replies
4. Shell Programming and Scripting
I have output like the following:
B D 20070116095820001 N D S0000579.LOG S0000582.LOG
B D 20070116095750001 N D S0000574.LOG S0000576.LOG
B D 20070116095734001 N D S0000570.LOG S0000573.LOG
B D 20070116095705001 N D S0000569.LOG S0000569.LOG
B D ... (5 Replies)
Discussion started by: rdudejr
5 Replies
5. Shell Programming and Scripting
Hello Experts,
I am being silly here and just need someone to point out what the silliness is
I have a bunch of lines that are
12343 words here that can chage (hat:98-345) more word and numbers here
I just want to pick out the numbers after "hat:" which is in every line. I have been... (8 Replies)
Discussion started by: gobi
8 Replies
6. Shell Programming and Scripting
I have some troubles with this:
insert (at the beginning of line) character "#" from line 5 to line 15 (3 Replies)
Discussion started by: aspire
3 Replies
7. Shell Programming and Scripting
How do I remove parentheses using sed?
input (192.168.1.1)
output 192.168.1.1 (4 Replies)
Discussion started by: streetfighter2
4 Replies
8. Shell Programming and Scripting
Im usind se as follows,
sed 's/**** DRAFT ****/ /' a.lst > b.lst
'**** DRAFT ****'
in a.lst goes to' ****' in b.lst
Does anyone know the right syntax?
Thanks!!
---------- Post updated at 11:02 AM ---------- Previous update was at 11:00 AM ----------
... (4 Replies)
Discussion started by: ttilsch
4 Replies
9. Shell Programming and Scripting
input1
a_a a/a 10 100
a1 a_a 20 200
b1 b_b 30 300
input2
a_a a/a xxx yyy
a1 a1 lll ppp
b1 b_b kkk ooo
output
a_a a/a 10 100 xxx yyy (2 Replies)
Discussion started by: ruby_sgp
2 Replies
10. UNIX for Beginners Questions & Answers
Hello,
I am on a Mac and trying to clean up some monthly files with a very simple SED:
sed '3,10d;/<ACROSS>/,$d' input.txt > output.txt
(from the input, delete lines 3 - 10; then delete from the line containing <ACROSS> to the end of the file)
then output to output.txt
Even when I try... (2 Replies)
Discussion started by: verbatim
2 Replies
LEARN ABOUT OPENSOLARIS
diffmk
diffmk(1) User Commands diffmk(1)
NAME
diffmk - mark differences between versions of a troff input file
SYNOPSIS
diffmk oldfile newfile markedfile
DESCRIPTION
diffmk compares two versions of a file and creates a third version that includes "change mark" (.mc) commands for nroff(1) and troff(1).
oldfile and newfile are the old and new versions of the file. diffmk generates markedfile, which, contains the text from newfile with
troff(1) "change mark" requests (.mc) inserted where newfile differs from oldfile. When markedfile is formatted, changed or inserted text
is shown by | at the right margin of each line. The position of deleted text is shown by a single *.
USAGE
See largefile(5) for the description of the behavior of diffmk when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
EXAMPLES
Example 1 An example of the diffmk command.
diffmk can also be used in conjunction with the proper troff requests to produce program listings with marked changes. In the following
command line:
example% diffmk old.c new.c marked.c ; nroff reqs marked.c | pr
the file reqs contains the following troff requests:
.pl 1
.ll 77
.nf
.eo
.nh
which eliminate page breaks, adjust the line length, set no-fill mode, ignore escape characters, and turn off hyphenation, respectively.
If the characters | and * are inappropriate, you might run markedfile through sed(1) to globally change them.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWdoc |
+-----------------------------+-----------------------------+
SEE ALSO
diff(1), nroff(1), sed(1), troff(1), attributes(5), largefile(5)
BUGS
Aesthetic considerations may dictate manual adjustment of some output. File differences involving only formatting requests may produce
undesirable output, that is, replacing .sp by .sp 2 will produce a "change mark" on the preceding or following line of output.
SunOS 5.11 14 Sep 1992 diffmk(1)