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:  257
View Complete with Replies

Related Messages:

reading a directory, first files the newest ones   (102 Views)
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
reading spreadsheets   (101 Views)
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;
Try this earn min 300 per month by reading 10 sms   (94 Views)
Try this earn min 300 per month by reading 10 sms 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... See how much you can make. Have fun calculating...and sign up. You will like it... -Manjunath
Device::Cdio - encapsulates CD control and reading   (93 Views)
In this initial object-oriented Perl interface to the C library 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 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.
reading in a file, line by line by picking certian lines   (91 Views)
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
Parsing/reading an XML output file   (117 Views)
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] 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
Question about reading a directory   (81 Views)
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
reading from stdin via pipe, buffering?   (78 Views)
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. ...
which is better when reading files   (116 Views)
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/; } ...
Ptk and threading...redux..   (91 Views)
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 forgive me for thinking out loud here.. I've recently been ...
reading from a file handle reference   (80 Views)
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 ...
detect keyboard input without reading it?   (84 Views)
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 ...
reading array data back into perl with YAML   (72 Views)
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 ...
Tk:Text and reading a never ending file   (126 Views)
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 ...
File Handle Reading Blues: Rereading a File Handle for Input   (123 Views)
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 ...
reading from stdin via pipe, buffering?   (112 Views)
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. ...
Socket: parent's writing fails while child reading from it after fork()   (88 Views)
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) ...
help me in reading the xml file   (158 Views)
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 ...
Re: reading and writing file names - thanks   (80 Views)
Tom -
Net::Daemon Q: Rereading caches in the "master" process?   (75 Views)
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 ...