Sponsored Content
Top Forums Shell Programming and Scripting A way to delete specific lines Post 302472277 by Scott on Tuesday 16th of November 2010 05:21:42 PM
Old 11-16-2010
Your question is somewhat vague. Not all of the lines you print are of the same length:
Code:
$ awk '{print length}' file1
136
136
99
99
99
136
135
99
99
136
$ awk 'length == 136' file1               
"2010-07-26","2010","07","26","*","26.90","","13.10","","20.00","","0.00","","2.00","","","M","","M","0.60","","","","0.00","","0.00",""
"2010-07-27","2010","07","27","*","26.80","","15.30","","21.10","","0.00","","3.10","","","M","","M","0.90","","","","0.00","","0.00",""
"2010-07-31","2010","08","06","*","25.40","","12.20","","18.80","","0.00","","0.80","","","M","","M","0.00","","","","0.00","","0.00",""
"2010-08-04","2010","07","28","*","30.10","E","17.30","E","23.70","E","0.00","E","5.70","E","","M","","M","6.90","E","","","","M","","M"

136, as far as fixed-length, gives the closest match.

Last edited by Scott; 11-16-2010 at 06:32 PM.. Reason: Wording
 

10 More Discussions You Might Find Interesting

1. Programming

Delete specific lines in a text file

Hi, experts, I would like to create a function that can calculate the total number of lines in a saved text file and delete specific lines in that particular file (I only want the last few lines). Hav anybody have the experience and giv me a hand in this? (9 Replies)
Discussion started by: dniz
9 Replies

2. UNIX for Advanced & Expert Users

How to delete specific lines at the same time

Dear All I have a pattern which look like this: 2 20080312_10:55:35.800 Spain-Telefonica ISC 9 IAM 927535957 34670505334 f 275 COT b 700 ACM b 6577 CPG b 10726 ANM b 202195 REL f 202307 RLC :COMMA: NCI=15,FCI=2101,CPC=0A,TMR=00,USI,OFI=00: :COMMB: BCI=0214,OBI=01,ACT: :RELCAUSE:10: This... (1 Reply)
Discussion started by: zanetti321
1 Replies

3. Shell Programming and Scripting

delete lines containing a specific word in afile

Hi, Please suggest how to write a shell script which delets all the lines containing the word unix in the files supplied as argument in the shell. (4 Replies)
Discussion started by: sireesha9
4 Replies

4. Shell Programming and Scripting

Delete specific lines from a file

Hi, I have a file ( all_users.ldif ) of the following format: cn=orcladmin, cn=Users, dc=maximus,dc=com cn=PUBLIC, cn=Users, dc=maximus,dc=com cn=portal,cn=users,dc=maximus,dc=com cn=portal_admin,cn=users,dc=maximus,dc=com cn=uddi_publisher,cn=Users,dc=maximus,dc=com... (4 Replies)
Discussion started by: itzz.me
4 Replies

5. Shell Programming and Scripting

How to delete all lines before a specific word?

Let's say we have a file containing: alllllsadfsdasdf qwdDDDaassss ccxxcxc#2222 dssSSSSddDDDD D1Sqn2NYOHgTI Hello Alex ssS@3 Ok, and let's say we want to delete all words from D1Sqn2NYOHgTI and back, this means to delete the words (and the lines of them) : alllllsadfsdasdf... (2 Replies)
Discussion started by: hakermania
2 Replies

6. Shell Programming and Scripting

Delete all lines after a specific line ?

Hello. My file is like this: a b c d e f g h i I want to delete all lines after the 3rd line, means after the "c". Is there any way to do this? The lines differ between them and the lines I want to delete does not have a specific word, or the lines I want to keep (a,b,c) does not have a... (4 Replies)
Discussion started by: hakermania
4 Replies

7. Shell Programming and Scripting

Delete multiple lines starting with a specific pattern

Hi, just tried some script, awk, sed for the last 2 hours and now need help. Let's say I have a huge file of 800,000 lines like this : It's a tedious job to look through it, I'd like to remove those useless lines in it as there's a few thousands : Or to be even more precise : if line1 =... (6 Replies)
Discussion started by: Zurd
6 Replies

8. UNIX for Dummies Questions & Answers

How to delete specific lines (2n+3 line, n=0,1,2...296) in a file?

Dear everyone, I have a file with 900 lines (there is only numbers in one line, no string), I only need the lines 2+3n (n=0,1...296), i.e line 2, 5, 8, 11...888. I tried google but only the results such as how to delete all the odd lines or all the even lines with 'awk' command. Thanks in... (4 Replies)
Discussion started by: phamnu
4 Replies

9. Shell Programming and Scripting

How to delete lines starting with specific string?

Dear all, I would like to delete even lines starting with "N" together with their respective titles which are actually odd lines. Below is the example of input file. I would like to remove line 8 and 12 together with its title line, i.e., line 7 and 11, respectively.... (2 Replies)
Discussion started by: huiyee1
2 Replies

10. Shell Programming and Scripting

Delete lines above and below specific line of text

I'm trying to remove a specific number of lines, above and below a specific line of text, highlighted in red: <STMTTRN> <TRNTYPE>CREDIT <DTPOSTED>20151205000001 <TRNAMT>10 <FITID>667800001 <CHECKNUM>667800001 <MEMO>BALANCE </STMTTRN> <STMTTRN> <TRNTYPE>DEBIT <DTPOSTED>20151207000001... (8 Replies)
Discussion started by: bomsom
8 Replies
rarpd(1M)																 rarpd(1M)

NAME
rarpd - Reverse Address Resolution Protocol daemon SYNOPSIS
config_file] [interface_name] DESCRIPTION
the Reverse Address Resolution Protocol daemon, implements the server portion of the Reverse Address Resolution Protocol [1]. It responds to RARP requests providing the requested client IP address. Rarpd can be started during boot-time initialization. To do so, set the vari- able with in Options are: Print debugging information. Use the specified config_file database instead of interface_name Respond to requests over just this interface. The configuration file database contains hardware address to IP address mappings. Other than comment lines (which begin with a '#') and blank lines, all lines are considered client entries. A client entry is of the form: hardware_address WHITE_SPACE ip_address where hardware_address consists of (colon-separated hexadecimal bytes, and ip_address consists of (dot-seperated decimal bytes. For exam- ple: # # hardware addr IP addr # # ethernet clients 08:00:09:26:ec:19 15.13.136.68 08:00:09:17:0a:93 15.13.136.74 # # 100VG clients 08:00:09:63:5d:f5 190.20.30.103 # # FDDI clients 08:00:09:09:53:4c 192.20.30.98 There must be exactly 6 hardware address bytes. There must be exactly 4 protocol address bytes. The following signals have the specified effect when sent to the process using the kill(1) command: Causes server to read the config file and reload database. Dumps current data base and cache to RETURN VALUE
Exit status is 1 if the command fails, and error messages are written to stderr and/or syslog. Typically, the daemon will continue answer- ing requests until externally interrupted. LIMITATIONS
1. The daemon supports only ethernet, 100VG and FDDI network interfaces. 2. The daemon supports only 4 byte Internet Protocol addresses. 3. The and programs cannot be run on the same interface at the same time. AUTHOR
was developed by HP. SEE ALSO
rarpc(1M). [1] R. Finlayson, T. Mann, J.C. Mogul, M. Theimer, "Reverse Address Resolution Protocol", RFC 903. rarpd(1M)
All times are GMT -4. The time now is 09:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy