Programming :: Processing Files Using Perl?

Aug 23, 2010

I am looking for some suggestions if possible, regarding processing the files using perl script. Scenario is I have a location where new files will be added always. I need to process these files for some validation. I wrote a perl script to do this and I thought I can rename the files once they are processed in that way I dont process the same files again. But now I can't rename the files due to some restrictions. Second thought, to process them based on date stamp but as my perlscript is being automated and runs every one hour to process the files I can't go by date stamp.

View 5 Replies


ADVERTISEMENT

Programming :: Comparing Two Files In Perl ?

Oct 9, 2009

I would like to ask opinion from perl experts.

I want to compare 2 files and show the differences in a text file.

For example, if i open File A an B in notepad

File A:

File B:

Quote:

line3 is missing in File B

So if I did a File compare (line by line), the differences will be in line3, line4, line5, line 6.

But I dont want it to be like that.

I want it to be like this

Quote:

Can Text:: Diff able to perform the work.

View 1 Replies View Related

Programming :: Download Files Using Perl?

Jul 24, 2010

How do I download a file to a specified location on disk in Perl?I tried doing a few web searches but suprisingly couldn't find anything.

View 4 Replies View Related

Programming :: PERL Count Files In A Dir?

Jul 8, 2009

I need to count files in a dir which were updated yesterday.

ls -lth | grep -i 'Jul 7' | wc -l

The dir holds files of last 15 days and total count is as 2067476. Is it efficient to count the files using perl? I have developed the following perl script making use of system().

Code:

#!/usr/bin/perl
@months = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
($sec,$min,$hour,$monthday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

[code]....

View 12 Replies View Related

Programming :: Compare Two Files Using Perl Or Shell Scripting?

Mar 8, 2010

I want to compare the following two tab-delimited .txt files (both were subsets of the original files) by comparing Columns 3 and 4 simultaneously. It is easy to compare C3 because both C3s are just numbers. But how to compare C4s?Basically, in File1, "G,G" = G in File2, "C,C" = C in File2, "A,A" = A in File2, "T,T"= T in File2.In File2, A/T in Column4 just equals "A,T" or "T,A" in Column4 of File1. C/T in Column4 just equals "C,T" or "T,C" in Column4 of File1, and etc.

File1:

C1C2 C3C4
ih509rs12345467244750"G,G"
ih499rs6049687244911"C,C"
ih508- 7244977"A,A"

[code]....

View 2 Replies View Related

Programming :: Perl - Counting Files With File - Find

Dec 20, 2010

So this is my code:

Code:

Modification of code I found here. It works, but I don't really know why.

Q1: Why is each filter hit counted only when the conditional is not true?

Q2: I've tried taking the file type, (.old), and put it into a variable for better usability, but then the script fails.

View 14 Replies View Related

Programming :: Perl Script To Count Files And Directories Is Not Working?

Aug 26, 2010

I am new to perl scripting and wrote a perl script to read the directories and files and count the no of files in each directory and generate a log file. The problem is it is not printing anything to the log file. I am copying the script below.

!/usr/local/bin/perl
$dir= 'c:My ProjectsPerl ScriptsNew Folder' ;
$directory_count = 0;
$file_count=0;

[code].....

View 14 Replies View Related

Programming :: Standardize A Perl Script So That Can Use It No Matter How Many Input Files

Mar 21, 2010

I need write a script that can compare multiple input files and output a file. The basic idea is:1: All my input files are in the same format2: I want to find in-common lines (in-common 1) from some of my input files (e.g., input1, 2 an 3), and find in-common lines (in-common 2) from the rest of my input files (e.g., input 4,5,6,7). And then, compare in-common1 and in-common2 and remove any overlap from in-common 1.3: Output the remaining in-common 1 file after removing any of its overlap with in-common 2I know how to write this script by putting all the filenames in one script and compare them. But the thing is, if I have more input files, such as 100, it might not be that efficient to write all filenames in one script and compare them.

I am wondering if there is any way to do such as:1: put all input filenames in a text file (file1)2: write a script3: Everytime, when I run this script, it will read in file1 directly no matter how many input files I have, give an output.I want this because I will have more and more input files and I don't wanna add multiple lines in the script just for reading the new inputfiles and compare them with the previous files. So, I guess this is something related to making my script a package or standardize it and make it easy to use in the future no matter how many input files I will have.

View 5 Replies View Related

Fedora :: Processing Hidden Files

May 12, 2010

Doing "ls -a" provides a listing of the hidden files.To process all the .bak files you can do *.bak for:
that.bak
this.bak

But how do you process all the hidden files like:
.that.bak
.this.bak

What is the equivalent of *.bak for only the hidden files?

View 6 Replies View Related

Programming :: Cannot Extract Webpage For Processing

Aug 25, 2010

I am trying to extract a web page via Google for processing. I am able to create a proper query and test it using cut/paste into the address bar of my firefox browser.

When I attempt to extract the page with wget:
wget -O - -q "$query"
I do not see the information that is present when I used the browser.

View 2 Replies View Related

Programming :: Processing Lanuage Forums?

Jun 9, 2011

I'm attempting to learn 'processing', the language used on the Arduino but I am having a bad time finding resource because of the poorly chosen name. What I am trying to do is open a pipe to another process/program to use as input to the processing plot program I am writing. I found processing.org but that site is not very helpful. There is plenty of examples of reading from an Arduino from the serial port but I want to read from a program running on my laptop. Both the plot and data accumulator program in the same PC.

View 3 Replies View Related

OpenSUSE Network :: Apache2 Not Processing Php Files

May 6, 2011

I'm running apache2 and I installed php5 with yast. httpd2 -M states that php5 is loaded. /etc/apache2/conf.d/php5.conf is being included in httpd.conf and it contains:

Code:
<IfModule mod_php5.c>
AddHandler application/x-php .php
AddHandler application/x-httpd-php .php4
AddHandler application/x-httpd-php .php5

[Code]....

The first line was added by me since that's what mime.types actually contains.

php.ini is in /etc/php5/apache2 and since I was not sure apache/php was finding it I added a PHPIniDir "directive" into httpd.conf. I have not changed it.

Test file is the typical /srv/www/htdocs/info.php with <?php infophp(); ?>

Normal index.htm is working fine. php -a is working fine.

I spent a long afternoon around this configuration and I looked in plenty of pages for solutions. I only do occasional system administration so I might have easily overlooked something trivial, but I run out of ideas.

There is a thread in this web site with a similar problem but no solution:

Php5 not recognized in SUSE 10.2 Apache2

What could be missing/wrong if php5 is loaded and the addhandler is defined? How can I further test?

View 9 Replies View Related

Fedora Installation :: How To Use Processing.org's Processing-1.0.9 As Application?

Mar 1, 2010

New to Fedora (from Windows), I am up and running ok with packages from the repository but only half ok with Processing, the Java graphics programming front end from processing.org.Their download gave me a .tgz file which Package Manager extracted for me into a location of my choice and where there is now a "processing" shell script.This works ok and I have managed to create a launcher on the desktop. That starts ok but always with processing's default action of giving you a new and automatically named work file.In Windows an existing Processing file (.pde file) could be "opened-with" Processing. Trying to do similar in Fedora I find that I am expected to nominate an Application to open with but Processing has not installed as an application.I guess the question is how do I promote Processing to be an Application?Or is there a different approach?

View 4 Replies View Related

Ubuntu :: Errors Were Encountered While Processing: Base-files

Jan 20, 2010

I'm unable to install any package on my Ubuntu, apt-get terminates with following error message. I'm using Ubuntu Intrepid 8.10

Code:
baipaneni@Baipaneni:~$ sudo apt-get install python-tagpy
[sudo] password for baipaneni:
Reading package lists... Done
Building dependency tree

[Code]....

View 3 Replies View Related

Ubuntu Multimedia :: 10.04 -- No Sound -- Errors In Processing Files?

Apr 12, 2011

Ubuntu 10.04 with an HP d530 SFFFrom lspci:00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)When trying to do sudo apt-get install -f, I get this:

Errors were encountered while processing:
libdirac-encoder0
libfaac0

[code].....

View 1 Replies View Related

Networking :: Automate The Transfer And Processing Of Files Between Two Systems?

Oct 30, 2010

I'm trying to automate the transfer and processing of files between two systems to help test and compare a new server installation. The workflow is a bit complex but I'm basically modifying a script on server 'A' to push a file to server 'B' as standard input to another script.

[Code]...

But no luck. I've tried it without the port in the server_args parameter, without the '-l' option; I've tried having the server parameter set to 'tcpd' and the call to '/bin/nc' in the server_args too. But no success. Can anyone point out what I'm doing wrong with the config? PS. I've restarted xinetd and server B is listening on port 1112 and accepting connections - but nothing gets piped into the script on server B.

View 2 Replies View Related

Programming :: Entering Value That Software Asks During Processing File

Dec 9, 2010

I use the below loop to process each file (listed in a text file) with a software. During processing the software asks me to enter a value and continues processing of that file after I enter the value. I have those values stored in a text file "myfile". What I want is to get the values directly from myfile when the software asks "please enter the title:". I dont want to enter them all manually. But i could not figure out how to code this in Bash script.

Code:
for ((i=1,i<=$NR,i++)); do
--command of the software comes here--
done

View 4 Replies View Related

Programming :: Gawk Getline Eats Next Line For Processing?

Mar 19, 2011

I'm working on a simple data processing script.My script uses a loop with getline to check for the value on the next line to decide if it's time to terminate the loop.This works dandy, but the problem is that getline eats that line, which then isn't processed by the rules in the remainder of the script (even though I want it to be). To illustrate what I mean, consider this simple gawk script:

Code:
{
print $0

[code]...

View 8 Replies View Related

Programming :: SED Processing - Export Progress Bar From Wget Display

Nov 2, 2010

I am attempting to "export" the progress bar from wget display using sed. Basically, we have an app that starts wget to download a large file and we want to show a progress bar. Our application has a dbus interface to receive the download progress.

So we were think of a command like:
wget [] | sed [] | dbus-send[]
The problem at the moment is, how do you get the matched string out of sed and into dbus-send? I can get the progress string by:
sed -u 's/[0-9]*%/&/'

This populated '&' with the correct percentage, but I cannot seem to get this out of sed.

View 9 Replies View Related

Programming :: Processing A Command Line Literally (without Shell Quoting)

Aug 31, 2010

Does anyone know a method of being able to process the complete and literal command line passed to a shell script ? I want to have the command line parameters with ALL characters (including meta characters e.g. $ literally).

So as if there was no shell to substitute or expand parameters nor applying it quoting rules.

View 5 Replies View Related

Programming :: Reading File Permissions Into Bash Array For Processing

Dec 1, 2010

I would like to read unix file permissions into a bash array for processing but tbh I have no idea how to do this. Then I will check for each individual access right l, d, x etc.

View 11 Replies View Related

Programming :: Waiting For File To Copy Before Continuing Processing (Python)

Mar 25, 2010

I have a Python script that copies a couple of DLL's and EXE to a directory before running the EXE. It can be a fresh copy or the files can already be in the target directory and are then overwritten. The script uses shutil.copy() to copy the files and that works but as the files are copying processing continues and the script tries to run the files mid copy, causing an error.

I need a way to wait for the files to finish copying before the script continues. Putting the thread to sleep isn't good enough, calling os.system("copy ...") also doesn't work, using os.path.exist() won't work because the file will exist during the copy.

View 2 Replies View Related

Programming :: Socket Programming In Module Perl

Jul 21, 2010

Where is the perl module for programming with sockets?

View 4 Replies View Related

Programming :: Cannot Install Perl / Tk

May 9, 2010

I just downloaded Tk-804.028 and try to install it (according to the README.linux) but I get:

> perl Makefile.PL
/opt/ActivePerl-5.10/bin/perl-static is installed in /opt/ActivePerl-5.10/lib okay
PPM for perl5.010001
Test Compiling config/perlrx.c
Test Compiling config/pmop.c
Test Compiling config/pregcomp2.c

[code]...

View 5 Replies View Related

Programming :: Perl Tutorial To Use?

May 18, 2011

Any recommendations on what Perl tutorial to use?

View 1 Replies View Related

Programming :: Converting MB/TB To GB In Perl?

Jan 30, 2010

I am taking an input from the user for free and Used capacity in a disk. I wish to convert Input entered in MBTB to GB and this is how i am doing it.

Code:

<some code>
print "Enter Total disk space";
$tot = <STDIN>;
convert($tot);

[code]...

how do i pass the value of conv[0] after conversion back to $tot or $use such that they contain only value which is in GB?

View 3 Replies View Related

Programming :: How To Get Perl Qt4 Working

Jul 24, 2010

I really would like Perl Qt4 bindings. The best I could find is this:[URL]The problem is that the sources would not compile, and the RPMs are for 32-bit machines.Is there really no such thing as good Perl Qt4 bindings?

View 8 Replies View Related

Programming :: MP3 - Tag And Perl Script

Mar 27, 2011

I am a newbie on linux and just searching everything about perl scripting and modules nearly 3-4 days. I need a perl script but one of not easy to find on searching google. Okay now I need a perl script which create or recreate (edit) id3 tags (artist, comment, album, year, cover) of mp3 files stored on my linux centos server. I installed MP3::Tag version 1.13 pearl module to my server. I Searched tutorials about how to use it, finally I get through reading id3 tag of mp3 file but not achieve to modify it or create a new id3tag.

These are the details:
I have a mp3 file called 1.mp3 this script will process that '1.mp3' file read its id3tag if there is one, than modify or create id3tag for it by my fix artist name for example:
'1.mp3' files id3 tag details are like this
Artist: Dj xx
Year:2010
Title:yyyyy
Comment:eerwer
Cover: x.jpg

Now via this perl script which uses MP3::TAG I will change it's
artist as YYY
Title:ttt
Comment:cool
Cover:t.jpg
these are gonna be my fixed values. I mean all '1.mp3' file will have same artist based on script value.

The reason of this script is I will share Dj podcasts on my server and Dj's would have upload their mp3's which has got different id3 tags and cover pics. etc. I want to create more organized podcasts of them by the way I would trigger this perl script via Cronjob.

View 14 Replies View Related

Programming :: How To Generate MD5 / Sha-1 With Perl

Mar 31, 2010

How can I generate a md5 or sha-1 code with perl?

View 2 Replies View Related

General :: Compare Two Files In Perl?

Oct 27, 2009

I want to compare two files in perl, I have two files file1.txt & file2.txt. if column1 on file2.txt match column1 on file1.txt then I want my result on file3.txt (column1 column2 file1.txt + column1 column2 column3 file2.txt). this problem was solved with "awk" but I want to do in perl.

file1.txt
---------
column1 column2
------- -------
linux-2049 1
linux-2817 1

[code]....

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved