06-20-2011
Thanks alot for your great response ! You guys here rock
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Friends,
We have four filenames with first few digits are identical.From those files, i need to pick up 2 files based on my parameter.
The following example will give more information to understand my question.
Files in the directory:
small_customer_aa.csv
small_customer_ab.csv... (6 Replies)
Discussion started by: HAA
6 Replies
2. Shell Programming and Scripting
Hi
Please tell me how could i delete symbols, whitespaces, characters, words everything between two words in a line. Let my file is
aaa BB ccc ddd eee FF kkk xxx
123456 BB 44^& iop FF 999
xxx uuu rrr BB hhh nnn FF 000
I want to delete everything comes in between BB and FF( deletion... (3 Replies)
Discussion started by: rish_max
3 Replies
3. Shell Programming and Scripting
Hi
Is it possible to do the following in a single command
/usr/xpg4/bin/sed -e '/rows selected/d' /aemu/CALLAUTO/callauto.txt > /aemu/CALLAUTO/callautonew.txt
/usr/xpg4/bin/sed -e '/^$/d' /aemu/CALLAUTO/callautonew.txt > /aemu/CALLAUTO/callauto_new.txt
exit (1 Reply)
Discussion started by: aemunathan
1 Replies
4. Shell Programming and Scripting
Hi !!!
I need to write a script(ksh) that deletes any character outside <start> tag and </start> from a file.
For eg:
$cat file.txt
<start>
ad
bd
</start>
as</start>
<start>
d
e
f
mb<start>mu
g
h
i (7 Replies)
Discussion started by: PRKS
7 Replies
5. Shell Programming and Scripting
I have a file that needs to be cleaned up. Here is the file:
Project
Project John
Project Gary
Project Sean
Project2
Project2 Lisa
Project2 Tyler
Project2 Sam
Project3
Project3 Mike
Project3 Bran
I need the o/p to be:
Project
John
Gary
Sean
Project2 (7 Replies)
Discussion started by: leepet01
7 Replies
6. Shell Programming and Scripting
Guys,
Here is the txt file...
SLIC N0SLU704034789 rŒ° EJ00 ó<NL DMRG>11 100 4B 2
SLIC N0SLU704034789 rΡ TJ10 <4000><NL> 2
SLIC N0SLU704034789 ... (2 Replies)
Discussion started by: gowrishankar05
2 Replies
7. Shell Programming and Scripting
i want to write a shell script that correct a text file.for example if i have the input file:
"john has has 2 apples
anne has 3 oranges oranges"
i want that the output file be like this:
"john has 2 apples
anne has 3 oranges"
i've tried to read line by line from input text file into array... (11 Replies)
Discussion started by: cocostaec
11 Replies
8. UNIX for Dummies Questions & Answers
I have a file that looks some like this:
I need to delete most of the information and sort the rest in such way that I get the following output file
Any help will be greatly appreciated (3 Replies)
Discussion started by: Xterra
3 Replies
9. UNIX for Dummies Questions & Answers
Hi there, newbie there. I've been browsing the forums hoping to find a solution that answers a problem similar to what I need, but haven't had much luck. Any help would be greatly appreciated. Thanks!
I need to delete a bunch of text between every appearance of two words in a really large file... (3 Replies)
Discussion started by: lendl
3 Replies
10. Shell Programming and Scripting
Hello,
I have a list of words separated by spaces I am trying to delete from a text file, and I could not figure out what is the best way to do this.
what I tried (does not work) :
delete="password key number verify"
arr=($delete)
for i in arr
{
sed "s/\<${arr}\>]*//g" in.txt
}
>... (5 Replies)
Discussion started by: Hawk4520
5 Replies
LEARN ABOUT DEBIAN
email::received
Email::Received(3pm) User Contributed Perl Documentation Email::Received(3pm)
NAME
Email::Received - Parse an email Received: header
SYNOPSIS
use Email::Received;
for ($mail->header("Received")) {
my $data = parse_received($_);
return "SPAM" if rbl_lookup($data->{ip});
}
DESCRIPTION
This module is a Perl Email Project rewrite of SpamAssassin's email header parser. We did this so that the great work they did in analysing
pretty much every possible Received header format could be used in applications other than SpamAssassin itself.
The module provides one function, "parse_received", which takes a single Received line. It then produces either nothing, if the line is
unparsable, a hash reference like this:
{ reason => "gateway noise" }
if the line should be ignored for some good reason, and one like this:
{ ip => '64.12.136.4', id => '875522', by => 'xxx.com',
helo => 'imo-m01.mx.aol.com' }
if it parsed the message. Possible keys are:
ip rdns helo ident envfrom auth by id
RULE FORMAT
Where SpamAssassin used a big static subroutine full of regular expressions to parse the data, we build up a big subroutine full of regular
expressions dynamically from a set of rules. The rules are stored at the bottom of this module. The basic format for a rule looks like
this:
((var=~)?/REGEXP/)? [ACTION; ]+
The "ACTION" is either "SET variable = $value", "IGNORE "reason"?", "UNPARSABLE" or "DONE".
One control structure is provided, which is basically an "if" statement:
GIVEN (NOT)? /REGEXP/ {
ACTION+
}
EXPORT
parse_received
SEE ALSO
Mail::SpamAssassin::Message::Metadata::Received, from which the rules and some of the IP address matching constants were blatantly stolen.
Thanks, guys, for doing such a comprehensive job!
AUTHOR
simon, <simon@>
COPYRIGHT AND LICENSE
Copyright (C) 2006 by simon
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or,
at your option, any later version of Perl 5 you may have available.
perl v5.10.0 2006-03-24 Email::Received(3pm)