![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| deleting white spaces in a file | mraghunandanan | UNIX for Dummies Questions & Answers | 2 | 05-26-2009 01:21 PM |
| csh script for deleting extra spaces in text file | hertingm | Shell Programming and Scripting | 2 | 03-12-2009 04:22 PM |
| Deleting end line spaces for along file | osymad | Shell Programming and Scripting | 3 | 02-23-2005 01:56 PM |
| deleting white spaces | cary530 | UNIX for Dummies Questions & Answers | 10 | 02-17-2004 01:22 PM |
| delete blank lines or lines with spaces only | vascobrito | UNIX for Dummies Questions & Answers | 3 | 01-13-2004 07:36 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 varying number of spaces from the start of the line to the first t. Ex: ' Track 9, .....' or ' t x y q.....' Is there a sed or grep expression I can use to delete these lines? Thanks in advance for any help. |
|
||||
|
Wow, thanks for the 2 quick responses.
I tried both and wound up with blank output files. Looking back at the original file, every numeric line has 2 spaces before the numbers start....is it possible to add that into the expression? I looked for how to represent a space in regular expressions but came up with 8 or 9 different syntax... P.S. I don't think I've ever seen the true value of consistently formatted files but I sure do now. P.P.S. Again thanks for the help. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|