Sponsored Content
Top Forums Shell Programming and Scripting Need Shell Script to delete lines in a file Post 302417473 by pseudocoder on Thursday 29th of April 2010 06:41:46 PM
Old 04-29-2010
As a matter of form I'll post a perl variant:
Code:
#!/usr/bin/perl
 
my $input='bankdata' ;
 
open(INPUT, "$input") or die "Error opening file: $!\n" ;
   while (<INPUT>) {
   chomp $_;
   @arrr = split(/,/);
    if ($arrr[0] !~ /^End of File/ ) {
      if ($arrr[1] !~ /[A-Z]/) {
 	if ($arrr[2] !~ /^0.00/) {
 	  print ("$_\n");
    }
   }
  }

 else {
 next ;
 }
}
close(INPUT);

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Delete all lines in a file from a script

I am trying to delete all the lines out a file from a unix script. Please help Platform is Sun (3 Replies)
Discussion started by: alnita
3 Replies

2. Shell Programming and Scripting

Need Help: Delete a file by Shell Script

Need some help here. We FTP out files to another server hourly. But before we can FTP to the other server. That server should send our server a "confirmation file" to tell us that they're ready to receive data. If they don't send the confirmation file, the files on our server should just stay... (5 Replies)
Discussion started by: r3edi
5 Replies

3. Shell Programming and Scripting

Delete lines at several places in a file with script

Hi, I am a newbie to shell scripting, and I have a file which quite large which I would like to delete lines at certain places. I want to search for a keyword which is recurring in the file. When matched I would like to delete the line. And when the file was so huge I thought I ought to learn... (3 Replies)
Discussion started by: mr_andrew
3 Replies

4. Shell Programming and Scripting

Delete lines from file using Unix Script

Hi Experts, I have a file in the below given format. First two lines are header and Trailer. Rest all are transaction Lines. I have to delete all other lines except first line (Header) and lines which contains 5000 in 1st column and 0 in 5th column. Can anyone please kindly provide me with... (6 Replies)
Discussion started by: phani333
6 Replies

5. Shell Programming and Scripting

HP Unix Script to Delete the lines in a file

Hi Experts, I have a file format as mentioned below. I would like to have unix script (HP Unix) which can: 1. Remove first 6 and last 3 lines. 2. Delete the lines where 3rd column having Alpha Numeric Number 3. Delete the lines where 4th column having 0.00 4. Calculate the sum of all the... (16 Replies)
Discussion started by: phani333
16 Replies

6. Shell Programming and Scripting

looking for a script that will delete lines in a text file

it will grep for a line and then delete these line. how do i begin to write this script if theres no available one? (3 Replies)
Discussion started by: garfish
3 Replies

7. Shell Programming and Scripting

script to delete lines from a txt file if pattern matches

File 6 dbnawldb010-b office Memphis_Corp_SQL_Diff Memphis-Corp-SQL-Inc-Application-Backup 03/09/11 03:24:04 42 luigi-b IPNRemitDB Memphis_Corp_SQL_Diff Memphis-Corp-SQL-Inc-Application-Backup 03/10/11 00:41:36 6 ebs-sqldev1-b IPNTracking Memphis_Corp_SQL_Diff... (4 Replies)
Discussion started by: ajiwww
4 Replies

8. Shell Programming and Scripting

How to delete the lines from file using script?

Hi Iam having file like below 10.238.52.65 pun-ras-bng-mhs-01 server 10.238.52.65 pun-ras-bng-mhs-01 10.10.10.10 10.238.52.65 pun-ras-bng-mhs-01 10.10.20.10 10.238.54.1 enk-ras-bng-cse-01 server 10.238.54.1 enk-ras-bng-cse-01 10.10.30.10 10.238.54.1 enk-ras-bng-cse-01 10.10.10.10 ... (5 Replies)
Discussion started by: surender reddy
5 Replies

9. Shell Programming and Scripting

Delete all CONSECUTIVE text lines from file shell scripting

Hi I have a text file like below. THe content of the text will vary. Entire text file have four consecutive lines followed with blank line. I want to delete the occurrence of the two consicutive lines in the text file. I don't have pattern to match and delete. Just i need to delete all... (5 Replies)
Discussion started by: RJSKR28
5 Replies

10. Shell Programming and Scripting

Shell script to merge and delete lines

POLY_STATS { EqName 103_tri Id 123 act_polyCount 1 act_polyValue 0 } POLY_STATS { EqName 103_tri Id 123 pass_polyCount 2 pass_polyValue 0 } POLY_STATS { EqName 103 Id 123 mes_polyCount 2 mes_polyValue 0 (5 Replies)
Discussion started by: Jag02
5 Replies
NEC2(1) 						      General Commands Manual							   NEC2(1)

NAME
nec2, nec2small - Numerical Electromagnetics Code (Antenna Modelling Program) SYNOPSIS
nec2 [INPUT] [OUTPUT] nec2small [INPUT] [OUTPUT] DESCRIPTION
nec2, is a versatile numerical Boundary Element Method (commonly called Method of Moments) antenna modelling code for the analysis of antennas and other metal structures. It solves the integral equations for the currents induced on the structure by sources or incident fields. The structure may either be excited by voltage sources on the structure, or by an incident plane wave of either elliptic or linear polarisation. The structure and excitation are described in the INPUT file and the output is written to OUTPUT. OPTIONS
Due to the age of the program, it expects input in the form of punched cards fed into a hopper. It currently does not accept any options. If OUTPUT is omitted, output is written to stdout and if INPUT and OUTPUT are omitted then the input is taken from stdin and the output written to stdout. The maximum size of problem which the code can handle must be hard coded at compile time and no dynamic memory allocation is performed. Two versions are therefore provided suitable for different sizes of problem, nec2 is compiled for a maximum of 10000 wire segments and 5000 surface patches, while nec2small is compiled for a maximum of 600 wire segments and 200 surface patches. SEE ALSO
somnec(1) The NEC-2 code is fully documented in the report Numerical Electromagnetics Code (NEC) -- Method of Moments" by Burke and Poggio, which is available as a printed publication in three parts covering the theory of operation, the program code and the users' manual. An updated form of the users' manual part of this report can be found in /usr/share/doc/nec/NECdoc BUGS
nec2 has been superseded by nec4, but this revised code has not been made available to the public, so it is possible that some bugs remain in this version. Also note that many variant source codes exist based on the original FORTRAN-IV listing in the report. This one is believed to be cor- rectly working, but may still contain extra errors. AUTHOR
This manual page was written by <alanb@chiark.greenend.org.uk>. The program was developed by G. J. Burke and A. J. Poggio of the Laurence Livermore Laboratory. NEC2(1)
All times are GMT -4. The time now is 02:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy