Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Deleting every other Line in VI Post 302349624 by Jahn on Tuesday 1st of September 2009 11:24:58 AM
Old 09-01-2009
Deleting every other Line in VI

Hello,

How would one delete every other two lines using VI? For example, I have the following 8 lines:

Code:
Line1
Line2
Line3
Line4
Line5
Line6
Line7
Line8

And wish to only delete lines 3-4 and 7-8. Is there a certain pattern which would make this easier?


Thank you,

-Jahn
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Checking the last line and deleting

Hi everyone, I have a file. I have to search whether the last line is empty(blank line) or not. if it is a blank line, I have to delete it. I dont want to move it to a temp file and again to original file after deleting the last line because I am doing some more modification in that file. Just I... (3 Replies)
Discussion started by: srivsn
3 Replies

2. Shell Programming and Scripting

Deleting First Two Characters On Each Line

How would one go about deleting the first two characters on each line of a file on Unix? I thought about using awk, but cannot seem to find if it can explicitly do this. In this case there might or might not be a field separator. Meaning that the data might look like this. 01999999999... (5 Replies)
Discussion started by: scotbuff
5 Replies

3. Shell Programming and Scripting

Deleting lines above a certain line

Hi, I have a file that gets automatically generated and it would look something like sakjsd adssad {{word}} sddsasd dsdsasa . . . So basically what I want to do is just keep the stuff below the {{word}} marker. The marker includes the brackets. Is there any command to delete the... (3 Replies)
Discussion started by: eltinator
3 Replies

4. UNIX for Advanced & Expert Users

Deleting First 10 letters in a line

Hi, Could any one of you let me know any simple Unix command for deleting first 10 letters of first line in unix? Eg: 123456789ABC --Input ABC--Output Thanks Sue (9 Replies)
Discussion started by: pyaranoid
9 Replies

5. Shell Programming and Scripting

Deleting Characters at specific position in a line if the line is certain length

I've got a file that would have lines similar to: 12345678 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 23456781 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 34567812 x.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 45678123 x.00 xx.00 xx.00 xx.00 xx.00 x.00 xxx.00 xx.00 xx.00 xx.00 xx.00... (10 Replies)
Discussion started by: Cailet
10 Replies

6. UNIX for Dummies Questions & Answers

Need help with deleting certain characters on a line

I have a file that looks like this: It is a huge file and basically I want to delete everything at the > line except for the number after “C”. >c1154... (2 Replies)
Discussion started by: kylle345
2 Replies

7. UNIX for Dummies Questions & Answers

deleting a line from output

Hi , I have a script taht returns result in teh following format : End of input file. a,b,c 3,4,5 s,d,f, End of input file. d,t,h r,t,y, 4,6,9 a,4,f e,6,7 End of input file. w,e,r the script that gives this result is : tcpdump ..... | |sort|uniq -c | head -10 (2 Replies)
Discussion started by: HIMANI
2 Replies

8. UNIX for Dummies Questions & Answers

Deleting the first line of .gz file

Hi All, I have too many .gz files (test.gz). Task is to remove first line of each file. Can I do it without unzipping the files? Your help is appreciated. (4 Replies)
Discussion started by: Chulamakuri
4 Replies

9. UNIX for Dummies Questions & Answers

Deleting a pattern in UNIX without deleting the entire line

Hi I have a file: r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e) I want to retain... (15 Replies)
Discussion started by: Alyaa
15 Replies

10. Shell Programming and Scripting

Deleting double quoted string from a line when line number is variable

I need to remove double quoted strings from specific lines in a file. The specific line numbers are a variable. For example, line 5 of the file contains A B C "string" I want to remove "string". The following sed command works: sed '5 s/\"*\"//' $file If there are multiple... (2 Replies)
Discussion started by: rennatsb
2 Replies
erl_comment_scan(3erl)					     Erlang Module Definition					    erl_comment_scan(3erl)

NAME
erl_comment_scan - Functions for reading comment lines from Erlang source code. DESCRIPTION
Functions for reading comment lines from Erlang source code. DATA TYPES
comment() = {integer(), integer(), integer(), [string()]} : EXPORTS
file(FileName::filename() (see module file)) -> [Comment] Types Comment = {Line, Column, Indentation, Text} Line = integer() Column = integer() Indentation = integer() Text = [string()] Extracts comments from an Erlang source code file. Returns a list of entries representing multi-line comments, listed in order of increasing line-numbers. For each entry, Text is a list of strings representing the consecutive comment lines in top-down order; the strings contain all characters following (but not including) the first comment-introducing % character on the line, up to (but not including) the line-terminating newline. Furthermore, Line is the line number and Column the left column of the comment (i.e., the column of the comment-introducing % char- acter). Indent is the indentation (or padding), measured in character positions between the last non-whitespace character before the comment (or the left margin), and the left column of the comment. Line and Column are always positive integers, and Indentation is a nonnegative integer. Evaluation exits with reason {read, Reason} if a read error occurred, where Reason is an atom corresponding to a Posix error code; see the module file(3erl) for details. join_lines(Lines::[CommentLine]) -> [Comment] Types CommentLine = {Line, Column, Indent, string()} Line = integer() Column = integer() Indent = integer() Comment = {Line, Column, Indent, Text} Text = [string()] Joins individual comment lines into multi-line comments. The input is a list of entries representing individual comment lines, in order of decreasing line-numbers ; see scan_lines/1 for details. The result is a list of entries representing multi-line comments, still listed in order of decreasing line-numbers , but where for each entry, Text is a list of consecutive comment lines in order of increasing line-numbers (i.e., top-down). See also: scan_lines/1 . scan_lines(Text::string()) -> [CommentLine] Types CommentLine = {Line, Column, Indent, Text} Line = integer() Column = integer() Indent = integer() Text = string() Extracts individual comment lines from a source code string. Returns a list of comment lines found in the text, listed in order of decreasing line-numbers, i.e., the last comment line in the input is first in the resulting list. Text is a single string, contain- ing all characters following (but not including) the first comment-introducing % character on the line, up to (but not including) the line-terminating newline. For details on Line , Column and Indent , see file/1 . string(Text::string()) -> [Comment] Types Comment = {Line, Column, Indentation, Text} Line = integer() Column = integer() Indentation = integer() Text = [string()] Extracts comments from a string containing Erlang source code. Except for reading directly from a string, the behaviour is the same as for file/1 . See also: file/1 . AUTHORS
Richard Carlsson <richardc@it.uu.se > syntax_tools 1.6.7 erl_comment_scan(3erl)
All times are GMT -4. The time now is 08:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy