Sponsored Content
Full Discussion: Urgent: Filtering a File
Top Forums Shell Programming and Scripting Urgent: Filtering a File Post 302073215 by ranj@chn on Thursday 11th of May 2006 04:16:12 AM
Old 05-11-2006
check man.

Check manual. Its all there. by the way, for your question -
comm -23 file1 file2 --> will give you lines in file1 and not in file2. You can redirect this output to a new file as required.
comm -23 file1 file2 >file3
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

filtering by file size

Hi ! I wanted to know how can i filter files by "size range". like : getting all the files that are bigger than 100 byte and smaller than 200 byte ? I want to make it as a script... I noticed the unix command : find . -size +100c but i also want limit it's upper bounds. so something... (2 Replies)
Discussion started by: nir
2 Replies

2. UNIX for Dummies Questions & Answers

problem in filtering the file

-------------------------------------------------------------------------------- Hi, Plz help me out with this. I have some requirement like this..... I have a file like this... * CS sent email (11.20) CALYPSO 1031276 9076673 CDSHY FAILED Nov 19 2007 7:28AM OASYS: Unable to find CUSTOMER... (0 Replies)
Discussion started by: adityam
0 Replies

3. UNIX for Dummies Questions & Answers

Filtering Log file

Hi, Iam trying to filter a log file in the below format |fffff|hhhhh|ffff|dd|mm|yy|hh|min||dd|mm|yy|hh|min the first set of |dd|mm|yy|hh|min is when the application ran the second set of |dd|mm|yy|hh|min when it ended. I will be removing the last of the months in the log file to... (1 Reply)
Discussion started by: baanprog
1 Replies

4. UNIX for Dummies Questions & Answers

Filtering a file

I have a list of directories looking something like; /usr/local/1/in /usr/local/1/out /usr/local/1/archive /usr/local/2/in /usr/local/2/out /usr/local/2/archive /usr/local/3/in /usr/local/3/out /usr/local/3/archive Is there a way I can filter the out and archive directories so I... (5 Replies)
Discussion started by: JayC89
5 Replies

5. Shell Programming and Scripting

filtering the log file

Hi i have a log file like example below. I need only one field from below log all other need to be truncated from the log file. 2011-06-13 15:10:53,498 INFO ext.SP->CAL (log point 5) can any body help on this please. Thanks (4 Replies)
Discussion started by: mostwantedkisss
4 Replies

6. Shell Programming and Scripting

[ask]filtering file to indexing...

dear all, i have file with format like this file_master.txt 20110212|231213|rio|apri|23112|222222 20110212|312311|jaka|dino|31223|543234 20110301|343322|alfan|budi|32131|333311 ... i want filter with output like this index_nm.txt rio|apri jaka|dino ... index_years.txt 20110212... (7 Replies)
Discussion started by: zvtral
7 Replies

7. UNIX for Dummies Questions & Answers

Filtering records from 1 file based on some manipulation doen on second file

Hi, I am looking for an awk script which should help me to meet the following requirement: File1 has records in following format INF: FAILEd RECORD AB1234 INF: FAILEd RECORD PQ1145 INF: FAILEd RECORD AB3215 INF: FAILEd RECORD AB6114 ............................ (2 Replies)
Discussion started by: mintu41
2 Replies

8. Shell Programming and Scripting

Filtering first file columns based on second file column

Hi friends, I have one file like below. (.csv type) SNo,data1,data2 1,1,2 2,2,3 3,3,2 and another file like below. Exclude data1 where Exclude should be treated as column name in file2. I want the output shown below. SNo,data2 1,2 2,3 3,2 Where my data1 column got removed from... (2 Replies)
Discussion started by: ks_reddy
2 Replies

9. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

10. Shell Programming and Scripting

Need help with filtering records in a file

Hi, I have following records in a file more file1.txt setting applicaction ABC for user setting applicaction CDE for user setting applicaction XXX for user logging applicaction XXX for user I need to filter out records which have strings " setting... (5 Replies)
Discussion started by: manid
5 Replies
Log::Handler::Output::File(3pm) 			User Contributed Perl Documentation			   Log::Handler::Output::File(3pm)

NAME
Log::Handler::Output::File - Log messages to a file. SYNOPSIS
use Log::Handler::Output::File; my $log = Log::Handler::Output::File->new( filename => "file.log", filelock => 1, fileopen => 1, reopen => 1, mode => "append", autoflush => 1, permissions => "0664", utf8 => 0, ); $log->log(message => $message); DESCRIPTION
Log messages to a file. METHODS
new() Call "new()" to create a new Log::Handler::Output::File object. The following options are possible: filename With "filename" you can set a file name as a string or as a array reference. If you set a array reference then the parts will be concat with "catfile" from "File::Spec". Set a file name: my $log = Log::Handler::Output::File->new( filename => "file.log" ); Set a array reference: my $log = Log::Handler::Output::File->new( # foo/bar/baz.log filename => [ "foo", "bar", "baz.log" ], # /foo/bar/baz.log filename => [ "", "foo", "bar", "baz.log" ], ); filelock Maybe it's desirable to lock the log file by each write operation because a lot of processes write at the same time to the log file. You can set the option "filelock" to 0 or 1. 0 - no file lock 1 - exclusive lock (LOCK_EX) and unlock (LOCK_UN) by each write operation (default) fileopen Open a log file transient or permanent. 0 - open and close the logfile by each write operation 1 - open the logfile if C<new()> called and try to reopen the file if C<reopen> is set to 1 and the inode of the file has changed (default) reopen This option works only if option "fileopen" is set to 1. 0 - deactivated 1 - try to reopen the log file if the inode changed (default) How to use fileopen and reopen Please note that it's better to set "reopen" and "fileopen" to 0 on Windows because Windows unfortunately haven't the faintest idea of inodes. To write your code independent you should control it: my $os_is_win = $^O =~ /win/i ? 0 : 1; my $log = Log::Handler::Output::File->new( filename => "file.log", mode => "append", fileopen => $os_is_win ); If you set "fileopen" to 0 then it implies that "reopen" has no importance. mode There are three possible modes to open a log file. append - O_WRONLY | O_APPEND | O_CREAT (default) excl - O_WRONLY | O_EXCL | O_CREAT trunc - O_WRONLY | O_TRUNC | O_CREAT "append" would open the log file in any case and appends the messages at the end of the log file. "excl" would fail by open the log file if the log file already exists. "trunc" would truncate the complete log file if it exists. Please take care to use this option. Take a look to the documentation of "sysopen()" to get more information. autoflush 0 - autoflush off 1 - autoflush on (default) permissions The option "permissions" sets the permission of the file if it creates and must be set as a octal value. The permission need to be in octal and are modified by your process's current "umask". That means that you have to use the unix style permissions such as "chmod". 0640 is the default permission for this option. That means that the owner got read and write permissions and users in the same group got only read permissions. All other users got no access. Take a look to the documentation of "sysopen()" to get more information. utf8 If this option is set to 1 then UTF-8 will be set with "binmode()" on the output filehandle. log() Call "log()" if you want to log messages to the log file. Example: $log->log(message => "this message goes to the logfile"); flush() Call "flush()" if you want to re-open the log file. This is useful if you don't want to use option "reopen". As example if a rotate mechanism moves the logfile and you want to re-open a new one. validate() Validate a configuration. reload() Reload with a new configuration. errstr() Call "errstr()" to get the last error message. close() Call "close()" to close the log file yourself - normally you don't need to use it, because the log file will be opened and closed automatically. PREREQUISITES
Carp Fcntl File::Spec Params::Validate EXPORTS
No exports. REPORT BUGS
Please report all bugs to <jschulz.cpan(at)bloonix.de>. If you send me a mail then add Log::Handler into the subject. AUTHOR
Jonny Schulz <jschulz.cpan(at)bloonix.de>. COPYRIGHT
Copyright (C) 2007-2009 by Jonny Schulz. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-11-21 Log::Handler::Output::File(3pm)
All times are GMT -4. The time now is 02:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy