Listening for files in a directory


I'm trying to make a solution that can listen for files in a given directory, and process the files as soon they have been written. So far I'm executing the script once per minute, but I would like a realtime ...
Posted On: Monday 26th of November 2012 08:36:47 PM Total Views:  301
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




Comparing 2 files using perl

Guys, I'm a total newbie to perl and I need to know how to go about comparing 2 seperate files using perl, to ascertain if the files are identical or if there are changes. Can you point me in the right direction of the right way to do thisAny guidance / tips would be immensely appreciated.
VIEWS ON THIS POST

86

Posted on:

Saturday 24th November 2012
View Replies!

Format fields in multiple files to Comma separated format.

In need script for taking field's from multiple files in one directory files have the same "fields".example file:---------------------#####\tTEST NAME\t\t\t\t\t\t\t\t\t\t: xxxxxxxx#####\tTEST OWNER\t\t\t\t\t\t\t\t\t: XXXxxxxxx#####\tXXX DIGIT IDENTIFIER\t\t\t\t: AAA, AAA, AAA---------------------Need format , separated starting with the FILENAME in the first field:Need format to look like this------------------------FILENAME, TEST NAME, xxxxxxxx, xxxxxxxx, AAA, AAA, AAAFILENAME, TEST NAME, xxxxxxxx, xxxxxxxx, AAA, AAA, AAAFILENAME, TEST NAME, xxxxxxxx, xxxxxxxx, AAA, AAA, AAAFILENAME, TEST NAME, xxxxxxxx, xxxxxxxx, AAA, AAA, AAA------------------------Hoping someone can help here Given two equally predictive theories, choose the simpler.\t
VIEWS ON THIS POST

113

Posted on:

Saturday 24th November 2012
View Replies!

Substitution between two files

Hi ,Lets say I have two files and want to perform a substitution of the data in file1 based on the file2. Based on these initial two files I would like file1 to be changed to what is below. Note: file2 will be about 2500 lines.CODE__file1__2345626122__file2__23, joe45, bob62, pawan61, kimber22, sue-lee..etcCODE__file1-revised__joebobpawankimbersue-le
VIEWS ON THIS POST

104

Posted on:

Saturday 24th November 2012
View Replies!

Orphaned files ( owner deleted)

I want to write a perl script for the below conditionFiles not contained in the user's home directory and files contained in the user's home directory, and owned by that user(user's account deleted), will remain on the system. The file will still be owned by the deleted account's user ID (UID).I want to throw a warning message whenever files(orphaned files) with no owners (i.e owner's deleted) are exists in the system. , Travis - have a star - a perfect example of using the right tool for the job... Steve"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::PerlDesignPatterns)
VIEWS ON THIS POST

93

Posted on:

Saturday 24th November 2012
View Replies!

comparing 2 files

i have 2 files and i want to compare i currently cat the files and awk print $1, $2 and doing if file1=file2 then fail, else exit 0what i want to do is compare values, with column 1 being a reference i want to compare line by line and then do:the values not matching is a successthe values matching is failurelike a vlookup in excelfile 1 scott 1.4suzy 3.5josh 5.3amanda 4.2luke 2.1file 2file2scott 4.1suzy 3.5josh 5.3amanda 2.4luke 1.2
VIEWS ON THIS POST

112

Posted on:

Saturday 24th November 2012
View Replies!

Re: How attach files and send mails on perl????

Armin Garcia wrote: > Hi !!!! , > Well i try to attach a file, but i dont know what function or method i need > to use, here is my code, i hope anybody can help me ....
VIEWS ON THIS POST

102

Posted on:

Sunday 25th November 2012
View Replies!

Comparing files with regular expressions

, I'm a Perl uber-novice and I'm trying to compare two files in order to exclude items listed on one file from the complete list on the other file. What I have so far prints out a third file listing ...
VIEWS ON THIS POST

209

Posted on:

Sunday 25th November 2012
View Replies!

Re: find files created/accessed in last n hours

use File::Find can do that. or use the unix 'find' command: find /path -type f -mmin -240 On 4/10/08, nag wrote: > hi, > please help me to get all the files present in a directory which are > ...
VIEWS ON THIS POST

116

Posted on:

Sunday 25th November 2012
View Replies!

Purpose of files in "..\Tk\demos\widget_lib" ?

I use ActiveState Perl 5.61 on Windows XP. I have a folder "..\Perl\site\lib\Tk\demos\widget_lib" with files like Button.pl and files like mkButton.pl. The files like Button.pl are used in Widget Demonstration programs, like the one by Steve Lidie (Which is ...
VIEWS ON THIS POST

64

Posted on:

Sunday 25th November 2012
View Replies!

How to make all files in one directory to an array

Hi all, How to form array by using the files available in particular directory for example, /tmp contains the following files.. #ls /tmp example.txt file1.txt file2.txt file3.txt sample.txt www.txt zzz.txt i want to take all the above files in ...
VIEWS ON THIS POST

116

Posted on:

Sunday 25th November 2012
View Replies!

Opening files with interpolation

I need help opening files. Basically, I have a directory full of html pages. These pages are templates, with variables where i want them. For example, lets say i have a file called test.html in my pages directory, and it ...
VIEWS ON THIS POST

88

Posted on:

Sunday 25th November 2012
View Replies!

chmod or setuid? Need to give script permission to write files

I am having a perl cgi script that needs to be able to create and write a new file. Is there a way I can use chmod within the script to give temporary world access to my directory, and ...
VIEWS ON THIS POST

94

Posted on:

Monday 26th November 2012
View Replies!

How to parse out specific data in text files and plugs into thespreadsheet

I need help writing a script in perl that takes text files and parses out specific data and plugs the data back into the spreadsheet. Can anyone help me on that.
VIEWS ON THIS POST

122

Posted on:

Monday 26th November 2012
View Replies!

Parsing two files and comparing the first fields..

I have two files (C:\test1.txt and C:\test2.txt) to parse. The first file has 4 fields and the second one has two fields, but both files have the "user_id" as the first field. Example: c:\test1.txt ================= jcarter john abc@gmail.com mstella mstella ...
VIEWS ON THIS POST

73

Posted on:

Monday 26th November 2012
View Replies!

FAQ 9.13 How do I edit my .htpasswd and .htgroup files with Perl?

This is an excerpt from the latest version perlfaq9.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest ...
VIEWS ON THIS POST

161

Posted on:

Monday 26th November 2012
View Replies!

How to generate parser from *.l and *.y files?

I have input files for lex and yacc (tok.l and gram.y). I could use lex and yacc to generate a parser from these files, but the generated code would be C. Is there a way to directly generate Perl code ...
VIEWS ON THIS POST

131

Posted on:

Monday 26th November 2012
View Replies!

dealing with large files in perl

Good day folks, I'm looking for some help and hoping to get some tips back. here's the situation: i've two large files containing one unique value in each file which is the id however, i have to go through each ...
VIEWS ON THIS POST

135

Posted on:

Monday 26th November 2012
View Replies!

Re: output from multiple files

On comp.unix.shell, in , "John W. Krahn" wrote: > > > suraj_c@hotmail.com wrote: >> There are three files called first , second and third . Each is having >> three columns >> >> $cat first >> a b c >> ...
VIEWS ON THIS POST

127

Posted on:

Monday 26th November 2012
View Replies!

filling a select box with a list of files

I'm looking for a perl script that can fill a "select" box (combo) from a file listing in a particular directory. Can someone direct me to a script that has already been written, or is this easy to do ...
VIEWS ON THIS POST

397

Posted on:

Monday 26th November 2012
View Replies!

need help with inherited script that emails files

This perl script goes through a list of files in IFILE and for each file, it sends it on to sendmail. Attachments need special handling and are signified in the email-file by having a line start with 3@ folowed by ...
VIEWS ON THIS POST

323

Posted on:

Monday 26th November 2012
View Replies!