Sponsored Content
Top Forums Shell Programming and Scripting Deleting lines not starting with numbers with sed Post 302482928 by anurag.singh on Thursday 23rd of December 2010 04:20:20 AM
Old 12-23-2010
I guess it should be:
Code:
sed '/^[^0-9]/d' file

OR
Code:
grep -v "^[^0-9]" file

This User Gave Thanks to anurag.singh For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting Multiple Lines with sed

I am trying to use sed to delete multiple lines in a file. The problem is that I need to search for a certain line and then once found delete it plus the next 4 lines. For instance if I had a file that consisted of the following lines: #Data1.start ( (Database= data1) (Name = IPC)... (1 Reply)
Discussion started by: rambo15
1 Replies

2. Shell Programming and Scripting

deleting lines after pattern using sed

I have seen there are many sed posts but still it is quite difficult to apply other post to my own problem How can I delete all lines in a file from 2 lines after this pattern *End_fine_coreg:_NORMAL to the end of file? Cheers (2 Replies)
Discussion started by: larne
2 Replies

3. Shell Programming and Scripting

Help deleting lines with SED.

I take the /etc/passwd file and print it out, but I only want the lines that end with sh. I have cat /etc/passwd | sed '/sh/!d' Which prints out all lines that have sh somewhere in it. So I added $, which I thought matches the ends on lines, but its not working, like for example I have have... (5 Replies)
Discussion started by: Bandit390
5 Replies

4. UNIX for Dummies Questions & Answers

Deleting lines starting with spaces then non-numerals

I did a search but couldn't find a thread that seemed to answer this but my apologies if it has been answered before. I have some text files and I need to remove any line that does not start with a number (0-9). In actuality every line like this starts with a 'T' (or 't') but there are a... (5 Replies)
Discussion started by: skray
5 Replies

5. Shell Programming and Scripting

Deleting lines using Sed

Hi All, Please can anyone help me as am deleting a line in a file with the below script: sed '/"$value"/d' redirects.virgin-atlantic.com.conf > olist where $value is a variable where the pattern to be matched is stored. I am not getting any error also but the line containing the pattern... (2 Replies)
Discussion started by: Shazin
2 Replies

6. Shell Programming and Scripting

sed: deleting 5 lines after a specified pattern

As an example (just an example, this could apply to any block of text) say I have this: architecture x86_64 cputype CPU_TYPE_X86_64 cpusubtype CPU_SUBTYPE_X86_64_ALL offset 4096 size 2972420 align 2^12 (4096) architecture ppc64 cputype CPU_TYPE_POWERPC64 cpusubtype... (3 Replies)
Discussion started by: pcwiz
3 Replies

7. Shell Programming and Scripting

deleting lines between patterns using sed or awk

hi, Here is excerpt from my xml file <!-- The custom module to do the authentication for LDAP --> </login-module> <login-module code="com.nlayers.seneca.security.LdapLogin" flag="sufficient"> <module-option... (1 Reply)
Discussion started by: sunrexstar
1 Replies

8. UNIX for Dummies Questions & Answers

Deleting last 3 lines from a file via sed

Hi Anybody can help me to delete the last 3 lines from a text file via sed under SunOS 5.8? Thanks Aldar (4 Replies)
Discussion started by: aldar
4 Replies

9. Shell Programming and Scripting

Deleting all lines containing numbers

Hi guys I have a text file in the following format what i would like ot do is iterate through the file deleting the lines containing only numbers. I have googled this and have been unable to find any help ( maybe its my search terms) so if any one an give me a heads up i would... (3 Replies)
Discussion started by: dunryc
3 Replies

10. Shell Programming and Scripting

Awk, sed - concatenate lines starting with string

I have a file that looks like this: John Smith http://www.profile1.com http://www.profile2.com http://www.profile3.com Marc Olsen http://www.profile4.com http://www.profile5.com http://www.profile6.com http://www.profile7.com Lynne Doe http://www.profile8.com http://www.profile9.com... (3 Replies)
Discussion started by: locoroco
3 Replies
PUBINDEX(1)						      General Commands Manual						       PUBINDEX(1)

NAME
pubindex - make inverted bibliographic index SYNOPSIS
pubindex [ file ] ... DESCRIPTION
Pubindex makes a hashed inverted index to the named files for use by refer(1). The files contain bibliographic references separated by blank lines. A bibliographic reference is a set of lines that contain bibliographic information fields. Each field starts on a line beginning with a `%', followed by a key-letter, followed by a blank, and followed by the contents of the field, which continues until the next line starting with `%'. The most common key-letters and the corresponding fields are: A Author name B Title of book containing article referenced C City D Date d Alternate date E Editor of book containing article referenced G Government (CFSTI) order number I Issuer (publisher) J Journal K Other keywords to use in locating reference M Technical memorandum number N Issue number within volume O Other commentary to be printed at end of reference P Page numbers R Report number r Alternate report number T Title of article, book, etc. V Volume number X Commentary unused by pubindex Except for `A', each field should only be given once. Only relevant fields should be supplied. An example is: %T 5-by-5 Palindromic Word Squares %A M. D. McIlroy %J Word Ways %V 9 %P 199-202 %D 1976 FILES
x.ia, x.ib, x.ic where x is the first argument. SEE ALSO
refer(1) local PUBINDEX(1)
All times are GMT -4. The time now is 04:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy