06-12-2007
append to fle using sed
Hello ,
I have the folloiwing command :
sed -n "$var,$final w $destfile" $sourcefile
where :
$var - $final represent the range of line numbers to be written in $destfile
However I require this command to work in a loop for which i need the sed command to keep appending the output to the $destfile .
Any Help ??
Thanks in advance ,
SD
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I think it should be obvious what I'm trying to do from my command, but just to be sure it's clear, I'm trying to append 2 lines after a matched line and then delete 2 other lines within a file. I'd like to do it in 1 line if possible.
This code isn't working, but hopefully it's just a syntax... (0 Replies)
Discussion started by: earnstaf
0 Replies
2. UNIX for Dummies Questions & Answers
I'm sure this is a simple one, but I'm new to UNIX and I can't figure it out.
How do I view file size in Megabytes? I have files in a directory and the size is 184710. I think this is in bytes but I'm not usre. How can I view this in MB.
Thanks. (4 Replies)
Discussion started by: bbbngowc
4 Replies
3. Shell Programming and Scripting
I have the following data in a file and would like to append the lines inside each section 10, 20, 30, 40, etc... onto one line for each of the sections. Is it possible with SED to make this happen??
10 00039393 DOCK: RECEIVE PART, TAG. D D
... (3 Replies)
Discussion started by: miklacic
3 Replies
4. Shell Programming and Scripting
Hello all,
I want to use sed to append a variable stored in $i, how do i do that?
$i contains a path to a directory and i want to append it before the result i get from awk statement, before affecting awk results.
rite now out put i get from code below is:-
The path is:... (2 Replies)
Discussion started by: asirohi
2 Replies
5. Shell Programming and Scripting
Hi friends,
I have a file with content SOME TEXT HERE
I want to append the string GREAT to Line 1 of my file such that the file content should be
GREAT
SOME TEXT HERE
I can do a cat for the string great and file >> newfile and then rename newfile name to file
But this does not put... (5 Replies)
Discussion started by: dahlia84
5 Replies
6. Shell Programming and Scripting
Hi all,
I have a file like
one two three for
five six seven eight
.....
Actually i need to append a label to the words that belong to the 2 column and get:
one two_label three for
five six_label seven eight
....
I was trying with sed inside vim but I can't figure out... (9 Replies)
Discussion started by: Dedalus
9 Replies
7. Shell Programming and Scripting
Input:
gstreamer-plugins-good
gstreamer-plugins-bad
gstreamer-plugins-ugly
Output should be:
gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly
How can it be done with sed? (5 Replies)
Discussion started by: cola
5 Replies
8. Shell Programming and Scripting
I am trying to replace in multiple files every instance of text that begins with http and add hyperlink characters to it. I can get it to work with the following:sed -e "s/http*.*/<a href=\"&\">&<\/a>/g" *
as long as the http text is at the end of the file. I need it to stop at the end of the... (2 Replies)
Discussion started by: numele
2 Replies
9. Shell Programming and Scripting
im trying to append to the end of the line using sed but I want to do it without creating a new line
the text to which I want to append is all in capital letters.
I want to do something like this:
LINE]Foo
but when I do this:
//a\
] Foo
it prints foo on a new line:
LINE
]Foo
... (11 Replies)
Discussion started by: mrjavoman
11 Replies
10. Shell Programming and Scripting
I have a requirement where I need to add a variable value based on a pattern match. When I try this it works:
sed '/IS_ETL_DEV/a\
ABCD' File1.txt > File1.tmp
Now I want to replace IS _ETL_DEV with a variable like $Pattern and replace the values ABCD with a variable $Var the value "$$XYZ=1".... (4 Replies)
Discussion started by: vskr72
4 Replies
CFTE(1) General Commands Manual CFTE(1)
NAME
cfte - Compiles fte config files
SYNOPSIS
cfte sourcefile [destfile]
DESCRIPTION
This manual page documents briefly the cfte.
This manual page was written for the Debian GNU/Linux distribution (but may be used by others), because the original program does not have
a manual page. Instead, it has documentation in html format; see below.
cfte compiles the .fterc binary for fte(1) from human readable sources. Example of these source files can be found at
/usr/share/doc/fte/config-example.tar.gz.
EXAMPLES
cfte /usr/share/doc/fte/config/main.fte
compiles the example config tree to fte-new.cnf
cfte main.fte ~/.fterc
compiles the main.fte (in current directory) to ~/.fterc
FILES
~/.fterc
Default Configuration file. Includes All keybinding and menus compiled with cfte from config files in /usr/share/doc/fte/con-
fig/main.fte. There is a sample .fterc in /etc/fte/system.fterc.
*.fte Configuration sources. The syntax of these files is explained in /usr/share/doc/fte/contents.html.
SEE ALSO
xfte(1), vfte(1), sfte(1), /usr/share/doc/fte/contents.html
AUTHORS
This manual page was written by Riku Voipio and Zdenek Kabelac <riku.voipio@iki.fi> <kabi@debian.org> for the Debian GNU/Linux system.
DATE
28 Sep 1999
CFTE(1)