Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Deleting every other Line in VI Post 302349632 by Jahn on Tuesday 1st of September 2009 11:40:34 AM
Old 09-01-2009
Is there a way to do it from command mode? i.e., increase line position by two, delete two lines, increase line position, etc.

Thanks,

-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
is  a  text formatter.	Its input consists of the text to be out-
put, intermixed with formatting commands.  A  formatting  command
is  a  line  containing  the  control character followed by a two
character command name, and possibly one or more arguments.   The
control  character is initially . (dot).  The formatted output is
produced on standard output.  The formatting commands are  listed
below, with being a number, being a character, and being a title.
A + before n means it may be signed,  indicating  a  positive  or
negative change from the current value.  Initial values for where
relevant, are given in parentheses.
  .ad	  Adjust right margin.
  .ar	  Arabic page numbers.
  .br	  Line break.  Subsequent text will begin on a new line.
  .bl n   Insert n blank lines.
  .bp +n  Begin new page and number it n. No n means +1.
  .cc c   Control character is set to c.
  .ce n   Center the next n input lines.
  .de zz  Define a macro called zz. A line with .. ends definition.
  .ds	  Double space the output. Same as .ls 2.
  .ef t   Even page footer title is set to t.
  .eh t   Even page header title is set to t.
  .fi	  Begin filling output lines as full as possible.
  .fo t   Footer titles (even and odd) are set to t.
  .hc c   The character c (e.g., %) tells roff where hyphens are permitted.
  .he t   Header titles (even and odd) are set to t.
  .hx	  Header titles are suppressed.
  .hy n   Hyphenation is done if n is 1, suppressed if it is 0. Default is 1.
  .ig	  Ignore input lines until a line beginning with .. is found.
  .in n   Indent n spaces from the left margin; force line break.
  .ix n   Same as .in but continue filling output on current line.
  .li n   Literal text on next n lines.  Copy to output unmodified.
  .ll +n  Line length (including indent) is set to n (65).
  .ls +n  Line spacing: n (1) is 1 for single spacing, 2 for double, etc.
  .m1 n   Insert n (2) blank lines between top of page and header.
  .m2 n   Insert n (2) blank lines between header and start of text.
  .m3 n   Insert n (1) blank lines between end of text and footer.
  .m4 n   Insert n (3) blank lines between footer and end of page.
  .na	  No adjustment of the right margin.
  .ne n   Need n lines.  If fewer are left, go to next page.
  .nn +n  The next n output lines are not numbered.
  .n1	  Number output lines in left margin starting at 1.
  .n2 n   Number output lines starting at n.  If 0, stop numbering.
  .ni +n  Indent line numbers by n (0) spaces.
  .nf	  No more filling of lines.
  .nx f   Switch input to file f.
  .of t   Odd page footer title is set to t.
  .oh t   Odd page header title is set to t.
  .pa +n  Page adjust by n (1).  Same as .bp
  .pl +n  Paper length is n (66) lines.
  .po +n  Page offset.	Each line is started with n (0) spaces.
  .ro	  Page numbers are printed in Roman numerals.
  .sk n   Skip n pages (i.e., make them blank), starting with next one.
  .sp n   Insert n blank lines, except at top of page.
  .ss	  Single spacing.  Equivalent to .ls 1.
  .ta	  Set tab stops, e.g., .ta 9 17 25 33 41 49 57 65 73 (default).
  .tc c   Tabs are expanded into c.  Default is space.
  .ti n   Indent next line n spaces; then go back to previous indent.
  .tr ab  Translate a into b on output.
  .ul n   Underline the letters and numbers in the next n lines.
All times are GMT -4. The time now is 10:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy