Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Remove footer record in specific condition Post 303009206 by KK230689 on Monday 11th of December 2017 01:01:36 AM
Old 12-11-2017
Remove footer record in specific condition

Hi Experts,

we have a requirement , need your help to remove the footer record in the file.

Input file :

Code:
1011070375,,21,,NG,NG,asdfsfadf,1011,,30/09/2017,ACI,USD,,0.28,,,,,,,,,,,,
1011070381,,21,,NG,NG,sgfseasdf,1011,,30/09/2017,ACI,GBP,,0.22,,,,,,,,,,,,
1011070389,,21,,NG,NG,werwfsafds,1011,,30/09/2017,ACI,USD,,0.63,,,,,,,,,,,,
1011070389,,21,,NG,NG,safsdgfe,1011,,30/09/2017,ACI,EUR,,0.63,,,,,,,,,,,,
1011070456,,94,,GB,GB,sfsdsa,1011,,31/10/2017,ACI,GBP,,0.55,,,,,,,,,,,,
JE,11-01-2017/05:38,26504


The above highlighted record needs to remove in the file
instead of "JE", some other values also will come. so start with "JE" will fails to convert dynamically.

Thanks in advance

Moderator's Comments:
Mod Comment Please post in the appropriate forum

Moderator's Comments:
Mod Comment Please use code tags

Last edited by Scrutinizer; 12-11-2017 at 02:47 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to Chop Header and Footer record from input file

Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
Discussion started by: coolbudy
4 Replies

2. Shell Programming and Scripting

remove header and footer rows

I would like to remove some lines from begining of file (header) and some lines from end of file (footer). The header/footer lines generated by web-browser when the user upload a file to my webserver. Example: -----------------------------7d62af20c052c Content-Disposition: form-data;... (2 Replies)
Discussion started by: seaky
2 Replies

3. Shell Programming and Scripting

Remove the footer from a flat file by searching a pattern

Hi, I have more than 30,000 records in a flat file. I want to remove footer from the file by searching a string pattern for the footer. Example.... let the flat file test.dat contains below records. record1 record2 record3 .. .. .. record31000 Total records 31000 I want to remove the... (6 Replies)
Discussion started by: gani_85
6 Replies

4. Shell Programming and Scripting

Help with File processing - Adding predefined text to particular record based on condition

I am generating a output: Name Count_1 Count_2 abc 12 12 def 15 14 ghi 16 16 jkl 18 18 mno 7 5 I am sending the output in html email, I want to add the code: <font color="red"> NAME COLUMN record </font> for the Name... (8 Replies)
Discussion started by: karumudi7
8 Replies

5. UNIX for Dummies Questions & Answers

remove the header and footer using sed

I want to delete the header and footer in the file by using sed for that i ran the below script and my text file looks like emp.txt # This file contain employee # information abc 12300 34 'FGH' # This is confidential as per the firm rules. my intention is to remove the header... (8 Replies)
Discussion started by: vmachava
8 Replies

6. Shell Programming and Scripting

Grab unique record from different files on a condition

Hi, I think this is the toughest prob :wall: I have ever come across and I thankfully owe all of u for helping me cross this. cat 1.txt cat 2.txt K now. This is what I am looking for. Output.txt Here is how my output has been generated. First, the column one of each file... (6 Replies)
Discussion started by: jacobs.smith
6 Replies

7. Shell Programming and Scripting

Add header and footer with record count in footer

This is my file(Target.txt) name|age|locaction abc|23|del xyz|24|mum jkl|25|kol The file should be like this 1|03252012 1|name|age|location 2|abc|23|del 2|xyz|24|mum 2|jkl|25|kol 2|kkk|26|hyd 3|4 Column 1 is row indicator for row 1 and 2, column indicator is 1,for data rows... (1 Reply)
Discussion started by: itsranjan
1 Replies

8. Shell Programming and Scripting

[AWK script]Counting the character in record and print them in condition

.......... (1 Reply)
Discussion started by: Antonlee
1 Replies

9. Programming

[solved] how to remove header and footer

it still display header and footer header SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 24 13:41:51 2012 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production With the Partitioning, Real... (0 Replies)
Discussion started by: ment0smintz
0 Replies

10. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies
Statistics::Basic::Mode(3pm)				User Contributed Perl Documentation			      Statistics::Basic::Mode(3pm)

NAME
Statistics::Basic::Mode - find the mode of a list SYNOPSIS
Invoke it this way: my $mode = mode(1,2,3,3); Or this way: my $v1 = vector(1,2,3,3); my $mod = mode($v1); And then either query the values or print them like so: print "The mod of $v1: $mod "; my $mq = $mod->query; my $m0 = 0+$mod; # this will croak occasionally, see below The mode of an array is not necessarily a scalar. The mode of this vector is a vector: my $mod = mode(1,2,3); my $v2 = $mod->query; print "hrm, there's three elements in this mode: $mod " if $mod->is_multimodal; Create a 20 point "moving" mode like so: use Statistics::Basic qw(:all nofill); my $sth = $dbh->prepare("select col1 from data where something"); my $len = 20; my $mod = mode()->set_size($len); $sth->execute or die $dbh->errstr; $sth->bind_columns( my $val ) or die $dbh->errstr; while( $sth->fetch ) { $mod->insert( $val ); if( defined( my $m = $mod->query ) ) { print "Mode: $m "; } print "Mode: $mod " if $mod->query_filled; } METHODS
new() The constructor takes a list of values, a single array ref, or a single Statistics::Basic::Vector as arguments. It returns a Statistics::Basic::Mode object. Note: normally you'd use the mean() constructor, rather than building these by hand using "new()". is_multimodal() Statistics::Basic::Mode objects sometimes return Statistics::Basic::Vector objects instead of numbers. When "is_multimodal()" is true, the mode is a vector, not a scalar. _OVB::import() This module also inherits all the overloads and methods from Statistics::Basic::_OneVectorBase. OVERLOADS
This object is overloaded. It tries to return an appropriate string for the calculation or the value of the computation in numeric context. In boolean context, this object is always true (even when empty). If evaluated as a string, Statistics::Basic::Mode will try to format a number (like any other Statistics::Basic object), but if the object "is_multimodal()", it will instead return a Statistics::Basic::Vector for stringification. $x = mode(1,2,3); $y = mode(1,2,2); print "$x, $y "; # prints: [1, 2, 3], 2 If evaluated as a number, a Statistics::Basic::Mode will raise an error when the object "is_multimodal()". AUTHOR
Paul Miller "<jettero@cpan.org>" COPYRIGHT
Copyright 2012 Paul Miller -- Licensed under the LGPL SEE ALSO
perl(1), Statistics::Basic, Statistics::Basic::_OneVectorBase, Statistics::Basic::Vector perl v5.14.2 2012-01-23 Statistics::Basic::Mode(3pm)
All times are GMT -4. The time now is 02:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy