deleteing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting deleteing
# 1  
Old 05-08-2008
deleteing

Dear Experts ,

I have 15 files and each files contains the data as mentioned below
fileA
name company salary
job location nationality
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
sports fottbal basket ball
total=888
I need a script which can remove the first two lines and the last two lines of each files .means i need a for loop for so that i cann process the 15 files.
the data which should remain is as mentioned below.
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123
12121 234234 13123

thanks
# 2  
Old 05-08-2008
Something like:

Code:
awk '$1 ~ /^[0-9]/{print}'

Regards
# 3  
Old 05-08-2008
Code:
grep "^[0-9].*" <filenames>

# 4  
Old 05-09-2008
Quote:
Originally Posted by aju_kup
Code:
grep "^[0-9].*" <filenames>

Hi, whether the above one or this one:
Code:
grep "^[0-9][0-9]*" <filenames>

is the correct regular expression to filter the lines that contain only numeric values (numbers)?? or both are same (can be used interchangeably)?
# 5  
Old 05-09-2008
Code:
grep "^[0-9][0-9]*" <filenames>

Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleteing duplicate lines sing uniq while ignoring a column

I have a data set that has 4 columns, I want to know if I can delete duplicate lines while ignoring one of the columns, for example 10 chr1 ASF 30 15 chr1 ASF 20 5 chr1 ASF 30 6 chr2 EBC 15 4 chr2 EBC 30 ... I want to know if I can delete duplicate lines while ignoring column 1, so the... (5 Replies)
Discussion started by: japaneseguitars
5 Replies

2. Shell Programming and Scripting

Deleteing one character after an special character

I have below line in a unix file, I want to delete one character after "Â". 20091020.Non-Agency CMO Daily Trade Recap Â~V Hybrids The result should be : 20091020.Non-Agency CMO Daily Trade Recap  Hybrids i dont want to use "~V" anywhere in the sed command or any other command, just remove... (1 Reply)
Discussion started by: mohsin.quazi
1 Replies

3. Linux

Deleteing archived files

Hi, I need to remove files that are in archive directory and which are old. I can make use of find command to search for files which are older by number of days. But the problem is there are sub directories in directory 'archive' like 'sub1' 'sub2' 'sub3'. Now all files which are in... (4 Replies)
Discussion started by: ramu_indian
4 Replies

4. UNIX for Dummies Questions & Answers

deleteing .doc file

hi i ama dunmmies in Unix. I created a .doc file and copied it to unix via FTP as a ,doc file itself i want to delete that file , i tried with rm command it does not work file name is DDL's.doc plz help :confused: (2 Replies)
Discussion started by: agarwalniru
2 Replies

5. Shell Programming and Scripting

Showing that something is deleteing

Hi there, I have a scritp that is clearing out old files from some directories, rather than echoing the name of the file when it gets deleted i want to echo a ". " I have tried to just echo it after the deletion but it lists like this . . . . I want to show it like this . . . . . . . . .... (1 Reply)
Discussion started by: nhatch
1 Replies
Login or Register to Ask a Question