I have a file with which i must remove the last line of the file (the footer). I know how to copy and redirect with tail -1 etc, but how do i delete it permanentely (4 Replies)
My data is xml'ish (here is an excerpt) :-
<bag name="mybag1" version="1.0"/>
<contents id="coins"/>
<bag name="mybag2" version="1.1"/>
<contents id="clothes"/>
<contents id="shoes"/>
<bag name="mybag3" version="1.6"/>
I want to delete line containing mybag2 and its subsequent... (5 Replies)
Hi,
How do I go about deleting a line in a text file. I have used grep to find a particlular word, now how do I delete the line?
so far I got:
grep -i $keyword file.txt (6 Replies)
I have file A with 10 lines and file B with 15 lines
I have to read each line from file A and match it with lines in file B
If matching lines are found i need to delete it from file B
The ouput will be the deleted file B
I tried the following in the loop but the deleting part is not... (5 Replies)
trying to use sed in finding a matching pattern in a file then deleting
the next line only .. pattern --> <ad-content>
I tried this but it results are not what I wish
sed '/<ad-content>/{N;d;}' akv.xml > akv5.xml
ex,
<Celebrant2First>Mickey</Celebrant2First>
<ad-content>
Minnie... (2 Replies)
PATTERN=""
sed "/$PATTERN/d" $file
In the file data is stored as
:::
:::
I need to delete only the line containing the PATTERN
pls help to point out why the above code is not working (4 Replies)
Sample file:
This is line one,
this is another line,
this is the PRIMARY INDEX line
l ;
This is another line
The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Hi,
I have a large text file with the following format:
>gi|347545744|gb|JN204951.1| Dismorphia spio voucher 5
ATCAAATTCCTTCCTCTCCTTAAA
>gi|17544664774|gb|WN204922.32| Rodapara nigens gene region
CCGGGCAAATTCCTTCCTCTCCTTAAA
>gi|555466400|gb|SG255122.8| Bombyx mandariana genbank 3... (1 Reply)
The awk below executes as expected if the id in $4 (like in f) is unique. However most of my data is like f1 where the same id can appear multiple times. I think that is the reason why the awk is not working as expected. I added a comment on the line that I can not change without causing the script... (6 Replies)
Discussion started by: cmccabe
6 Replies
LEARN ABOUT BSD
vi
VI(1) General Commands Manual VI(1)NAME
vi - screen oriented (visual) display editor based on ex
SYNOPSIS
vi [ -t tag ] [ -r ] [ +command ] [ -l ] [ -wn ] name ...
DESCRIPTION
Vi (visual) is a display oriented text editor based on ex(1). Ex and vi run the same code; it is possible to get to the command mode of ex
from within vi and vice-versa.
The Vi Quick Reference card and the Introduction to Display Editing with Vi provide full details on using vi.
FILES
See ex(1).
SEE ALSO
ex (1), edit (1), ``Vi Quick Reference'' card, ``An Introduction to Display Editing with Vi''.
AUTHOR
William Joy
Mark Horton added macros to visual mode and is maintaining version 3
BUGS
Software tabs using ^T work only immediately after the autoindent.
Left and right shifts on intelligent terminals don't make use of insert and delete character operations in the terminal.
The wrapmargin option can be fooled since it looks at output columns when blanks are typed. If a long word passes through the margin and
onto the next line without a break, then the line won't be broken.
Insert/delete within a line can be slow if tabs are present on intelligent terminals, since the terminals need help in doing this cor-
rectly.
Saving text on deletes in the named buffers is somewhat inefficient.
The source command does not work when executed as :source; there is no way to use the :append, :change, and :insert commands, since it is
not possible to give more than one line of input to a : escape. To use these on a :global you must Q to ex command mode, execute them, and
then reenter the screen editor with vi or open.
3rd Berkeley Distribution April 29, 1985 VI(1)