The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to get the data from line number 1 to line number 100 of a file Anji Shell Programming and Scripting 9 11-03-2008 04:59 AM
Adding a columnfrom a specifit line number to a specific line number Ezy Shell Programming and Scripting 2 05-12-2008 08:29 AM
[csh] checking for specific character ranges in a variable userix Shell Programming and Scripting 5 05-11-2008 07:56 AM
Appending line number to each line and getting total number of lines chiru_h Shell Programming and Scripting 2 03-25-2008 10:19 AM
Checking before start and stop processes maldini Shell Programming and Scripting 3 07-22-2005 02:35 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-13-2008
Satyak Satyak is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 85
Post checking whether line start with character or number

hi
i need to check a line whether it is starting with number or character ,if char i need to delete that line

please help

thanks in advance
Satya
  #2 (permalink)  
Old 10-13-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,643
Code:
sed '/^[A-Za-z]/d'   filename > newfilename
  #3 (permalink)  
Old 10-13-2008
Satyak Satyak is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 85
Post checking a line staring with number or not

hi jim , thanks for the quick reply
by mistaken i gave u the wrong requirement,
i need to delete all the lines which are not starting with numbers i.e 0-9
please help

Satya
  #4 (permalink)  
Old 10-13-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
Try out
Code:
sed '/^[^0-9]/d'   filename > newfilename
  #5 (permalink)  
Old 10-14-2008
summer_cherry summer_cherry is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2007
Location: Beijing China
Posts: 1,047
Code:
sed '/^[0-9][0-9]*/!d'
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 06:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0