![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| remove a line within a file | new2ss | UNIX for Dummies Questions & Answers | 3 | 11-23-2008 02:34 PM |
| sed remove last 10 characters of a line start from 3rd line | minifish | Shell Programming and Scripting | 7 | 03-26-2008 04:42 PM |
| SED help (remove line::parse again::add line) | Malumake | Shell Programming and Scripting | 6 | 10-24-2007 06:02 PM |
| Remove header(first line) and trailer(last line) in ANY given file | madhunk | Shell Programming and Scripting | 2 | 03-13-2006 03:36 PM |
| Remove first 15 line | bobo | UNIX for Dummies Questions & Answers | 6 | 01-30-2006 09:26 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
remove line 1 and save it....
Hi,
I have txt file like below: [0000.0217] report date [0000.0288] 1234567 [0000.0291] 2345234 [0000.1312] 8976542 How can I skip to read line 1 and grep the number 288, 291 and 1312 and save into another new txt file? |
|
||||
|
Quote:
|
|
||||
|
if you have Python installed and assume only a dot in each line.
Code:
#!/usr/bin/python
f=open("file")
f.readline()
for line in f:
whereisdot = line.index(".")
whereisclosebracket = line.index("]")
print line[whereisdot + 1: whereisclosebracket ]
Last edited by ghostdog74; 12-20-2006 at 02:03 AM.. |
|
||||
|
Quote:
and the first line should not be read as well.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|