Reading the name of a file in a .gz


, I need to read the name of a file inside a .gz. I know it should be the zipped name - .gz, but the filenames are long and truncated sometimes. In perl, what is the command to read the ...
Posted On: Monday 26th of November 2012 08:53:11 PM Total Views:  247
View Complete with Replies

RELATED TOPICS OF Perl PROGRAMMING LANGUAGE




reading a directory, first files the newest ones

When I read a huge directory with opendir, opendir(DIR,"dirname"); my $file; while($file=readdir(DIR)) whatever... it loads the oldest ones first. I would like the newest files first, instead of the oldest. Taking into account that I am only interested in the newest files, this takes a lot of time, as the directory is really huge. I am talking about thousands and thousands of files. I need to process the files that are two hours old from now. I am not interested in those older than two hours ago. I know that because I check the modification time with stat. any idea
VIEWS ON THIS POST

97

Posted on:

Saturday 20th October 2012
View Replies!

reading spreadsheets

everybody, Please help. I've got a bunch of Lotus 123 (version 9.8) files. Well it would be very good if these files could somehow be loaded into a Perl datastructure. Does Perl have a module for accomplishing this Any other ideas on how to get this file loaded up into a data structure without learning the specific lotus 123 file format Spreadsheet::Read doesnt want to open the file #!/usr/bin/perl use strict; use warnings; use Spreadsheet::Read; my $aref = 'UNDEFINED'; $aref = Spreadsheet::Read::ReadData('original.123'); print "aref is: [$aref]\n"; exit;
VIEWS ON THIS POST

94

Posted on:

Friday 26th October 2012
View Replies!

Try this earn min 300 per month by reading 10 sms

Try this earn min 300 per month by reading 10 sms mGinger.com pays you to read ads on your cellphone! These ads are only about your interests. Not only that, you get to decide when you want these ads. Based on my calculations I can easily make enough money to free up my cell phone bill. Check it out... http://www.mginger.com/index.jspinviteId=101209 See how much you can make. Have fun calculating...and sign up. You will like it... -Manjunath
VIEWS ON THIS POST

89

Posted on:

Friday 26th October 2012
View Replies!

Device::Cdio - encapsulates CD control and reading

In this initial object-oriented Perl interface to the C library libcdio (http://www.gnu.org/software/libcdio), audio CD controls, device controls, compact disc classification, various block CD read routines, and some track routines are provided. There are a number of example programs in the package demonstrating use. The module should be on CPAN eventually. (Although, at the time of this posting it isn't - see below). However the module is also available in the GNU ftp space via ftp://ftp.gnu.org:/pub/gnu/libcdio/D...-v0.0.1.tar.gz As this my first CPAN module, please go easy on me. If you are familiar with libcdio, you'll find perhaps about half of what's in libcdio. Much of the work is I think is a straightforward continuation of what's currently there. (Just getting this far was a bit more work than I expected.) Enjoy.
VIEWS ON THIS POST

87

Posted on:

Friday 26th October 2012
View Replies!

reading in a file, line by line by picking certian lines

Hi all I am looking at a way of reading a line doing a regex to find the specific line then pick out the line, sudo code would be some thing like the following: read in line check regex if regex is correct { jump 10 lines print the output } any ideas on jumping the 10 lines, how do I ignore the lines in the file, and know I'm going the right distance
VIEWS ON THIS POST

88

Posted on:

Sunday 4th November 2012
View Replies!

Parsing/reading an XML output file

I am new to perl scripting and trying to parse/read the below XML output file and genearate a log file that consists of the filename, location and error type.Condition: In my XML file it should look for the below tags and if the values in these tags are other than these then it should generate a log file as described above.( or)truetrueplease help..[XML file]6.02.1.0345fmt/7fmt/8fmt/9fmt/1018142902CCS docWORKS v6.2-1.172009:04:28 12:59:52-04:00C:\Documents and Settings\user\Desktop\images\63570660R_000002.jpg8430e764e73efc3b56d0b29a22a214711240937992000truetrueExifToolVersion 7.74FileName 63570660R_000002.jpgDirectory C:/Documents and Settings/user/Desktop/imagesFileSize 17 MBFileModifyDate 2009:04:28 12:59:52-04:00FileType TIFFMIMEType image/tiffExifByteOrder Little-endian (Intel, II)SubfileType Full-resolution ImageImageWidth 1984ImageHeight 3048BitsPerSample 8 8 8Compression UncompressedPhotometricInterpretation RGBFillOrder NormalImageDescription 000142676;The development of medical bibliography;1954;HMDMIA_000142676_00024_0008_x_xxx;12934274;MD5Make i2s Digibook ScannerModel Suprascan AO 14000 RGBStripOffsets 1206Orientation Horizontal (normal)SamplesPerPixel 3RowsPerStrip 3048StripByteCounts 18141696XResolution 400YResolution 400PlanarConfiguration ChunkyResolutionUnit inchesPageNumber 0 1Software CCS docWORKS v6.2-1.17ModifyDate 2009:04:27 12:55:53Artist OCLC Preservation Service Center for NLMHostComputer SUPRASCANA0 XP ProfessionalCopyright Copyright clearance obtained by NLMProfileCMMType ADBEProfileVersion 2.1.0ProfileClass Display Device ProfileColorSpaceData RGBProfileConnectionSpace XYZProfileDateTime 2000:08:11 19:51:59ProfileFileSignature acspPrimaryPlatform Apple Computer Inc.CMMFlags Not Embedded, IndependentDeviceManufacturer noneDeviceModelDeviceAttributes Reflective, Glossy, Positive, ColorRenderingIntent PerceptualConnectionSpaceIlluminant 0.9642 1 0.82491ProfileCreator ADBEProfileID 0ProfileCopyright Copyright 2000 Adobe Systems IncorporatedProfileDescription Adobe RGB (1998)MediaWhitePoint 0.95045 1 1.08905MediaBlackPoint 0 0 0RedTRC (Binary data 14 bytes, use -b option to extract)GreenTRC (Binary data 14 bytes, use -b option to extract)BlueTRC (Binary data 14 bytes, use -b option to extract)RedMatrixColumn 0.60974 0.31111 0.01947GreenMatrixColumn 0.20528 0.62567 0.06087BlueMatrixColumn 0.14919 0.06322 0.74457ImageSize 1984x3048 The code I was trying till now after going through perldocs is:#!/usr/local/bin/perl#use strict;#use warnings;use XMl::simple;use Data::Dumper;my $list = XMLin ('C:\Documents and Settings\user\Desktop\output\ NLM025350802\NLM025350802_000002.xml');foreach my $file ($list->{identification}) { if (defined($file->{identity format} eq 'JPEG') { print $file->{filename}."\n"; } } But it is showing up syntax error at (defined($file->{identity format} eq 'JPEG'). Will this logic work or can ayone suggest some other way in perl
VIEWS ON THIS POST

110

Posted on:

Wednesday 7th November 2012
View Replies!

Question about reading a directory

Hi Folks I know, its not really a TK-question, but I dont know a better way. Is there such a fast way to check if a directory contains subdirectories but reading the whole directory
VIEWS ON THIS POST

76

Posted on:

Wednesday 7th November 2012
View Replies!

reading from stdin via pipe, buffering?

I have written a perl program that reads from stdin: while() { chomp do_it($_); } Data is fed to it via a pipe: cat myfile | ./myprogram When running the program, the program doesn't always read the whole line. ...
VIEWS ON THIS POST

73

Posted on:

Saturday 10th November 2012
View Replies!

which is better when reading files

hi, who can tell me which is better of the following codes why there are different methods to read files thanks 1. open(INPUT, "< filedata") or die "Couldn't open filedata for reading: $!\n"; while () { print if /blue/; } ...
VIEWS ON THIS POST

113

Posted on:

Saturday 10th November 2012
View Replies!

Ptk and threading...redux..

FWIW: Yes I know that ptk doesn't support threads, and maybe never will, but I think enough of us have produced sufficient experimental results that the conversation isn't entirely closed...so forgive me for thinking out loud here.. I've recently been ...
VIEWS ON THIS POST

86

Posted on:

Thursday 15th November 2012
View Replies!

reading from a file handle reference

I am trying to read from a file handle reference using the angle operator <>. If I attempt to use a file handle that contains a hash reference I get a syntax error similar to this: $esfile = <{$drive_ref->{'reader'}}>; #points ...
VIEWS ON THIS POST

76

Posted on:

Thursday 15th November 2012
View Replies!

detect keyboard input without reading it?

Hi all, I was wondering if you could help out with this problem that I am having. What I am trying to do is detect keyboard input in a while loop without halting/pausing the loop until the key is pressed ...
VIEWS ON THIS POST

79

Posted on:

Thursday 15th November 2012
View Replies!

reading array data back into perl with YAML

I have a Perl hash: %dictionary = ( gema => [1], gemaadm => [1], admin => [1], Prague => [1], server => [1] ); and an array: @data = ( [gemaadm, abc123, "gema admin for Prague server"], [csvadm, abc123, "csv ...
VIEWS ON THIS POST

71

Posted on:

Monday 19th November 2012
View Replies!

Tk:Text and reading a never ending file

Hi This little problem is related to Tk::Text on Linux. I want to be able to monitor the text output from a script. In the same way as tail -f will do. That is the file being displayed is ...
VIEWS ON THIS POST

122

Posted on:

Monday 19th November 2012
View Replies!

File Handle Reading Blues: Rereading a File Handle for Input

Hi. I can't reread a file handle after I have copied it on another file handle for output. Here is the code snippet. Please let me know if you need more. Lines 26 & 27 are my attempts to get ...
VIEWS ON THIS POST

117

Posted on:

Monday 19th November 2012
View Replies!

reading from stdin via pipe, buffering?

I have written an perl program that read from stdin: while() { chomp do_it($_); } Data is fed to it via a pipe: cat myfile | ./myprogram When running the program, the program doesn't always read the whole line. ...
VIEWS ON THIS POST

56

Posted on:

Sunday 25th November 2012
View Replies!

Socket: parent's writing fails while child reading from it after fork()

Perl Cookbook (1st edition) contains an example (it's in the end of this post) in Section 17.10 Writing Bidirectional Clients . My problem is that the script works fine under FreeBSD, but under Windows 2000 (ActiveState Perl 5.8.0 build 804) ...
VIEWS ON THIS POST

82

Posted on:

Monday 26th November 2012
View Replies!

help me in reading the xml file

Hi , I have got an xml like this below. I want to read this file in Perl and want to retrieve the text which end with .xml. For example , I want to print the text "jms/hppjmsmodules-jms.xml", since it ...
VIEWS ON THIS POST

153

Posted on:

Monday 26th November 2012
View Replies!

Re: reading and writing file names - thanks

Tom -
VIEWS ON THIS POST

74

Posted on:

Monday 26th November 2012
View Replies!

Net::Daemon Q: Rereading caches in the "master" process?

Not sure this is the best place to post, but: I have a Perl daemon using Net: aemon (technically it uses RPC::PlServer, which inherits from Net: aemon). When the daemon starts up, it reads a bunch of system configuration information ...
VIEWS ON THIS POST

73

Posted on:

Monday 26th November 2012
View Replies!