Sponsored Content
Top Forums Shell Programming and Scripting Finding missing files that are named sequentially with Perl? Post 302354496 by newftronics on Friday 18th of September 2009 10:27:20 AM
Old 09-18-2009
Finding missing files that are named sequentially with Perl?

Hello

I am new to Perl, in fact I am on chapter one of the book. Smilie However I am in need of a Perl Script faster than I can finish the book. Perhaps someone can help me with my immediate need while I read my book.

I have a directory with hundreds of files that are all named like ABCD_21308_0636456392_001.ARC with the 21308 part of this file name being the sequential part of the files. Files come and go from the folder in which they reside with the oldest going first while new ones are created in the folder. The goal is to find missing files in the sequential order as they occure so as to retreive the missing file from the source in a timely fashion.

Files:

ABCD_21308_0636456392_001.ARC
ABCD_21309_0636456392_001.ARC
ABCD_21310_0636456392_001.ARC
ABCD_21311_0636456392_001.ARC
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

FTP Files Sequentially

Hi Gurus, i have to transfer files one by one from ftp server to target server all files which is to be transferred lies in one ftp folder i have to move those files sequentially from ftp to target and must verify files for successful transmission . then i have to delete corresponding... (1 Reply)
Discussion started by: harim
1 Replies

2. Shell Programming and Scripting

Finding perl files without documentation

I have an application consisting of a number of perl files. I want to find those perl files that have no documentation yet, so I tried the following from the root level of the directory where the application resides: perldoc -r * The output is something like the following: No documentation found... (2 Replies)
Discussion started by: figaro
2 Replies

3. Shell Programming and Scripting

Finding missing tags

I have a list containing strings. All strings should have either "smp" or "drw" else it is considered an error. I have written this code below. Any better ideas to tackle this? set fdrw = 0 set fsmp = 0 foreach f ($Lst) set fdrwtag = `echo $f | awk '/drw/'` set fsmptag = `echo $f | awk... (1 Reply)
Discussion started by: kristinu
1 Replies

4. Shell Programming and Scripting

Finding BEGINNING & ENDING positions of sequentially increasing sublists from a perl numeric array

I have got an Perl array like: @array = (1,2,3,4,5,6,1,2,3,4,1,2,1,2,3,4,5,6,7,8,9...............) This numeric sequence will be always sequentially increasing, unless it encounters, The beginning of the new sequentially increasing numeric sequence. SO in this array we get sequentially... (5 Replies)
Discussion started by: teknokid1
5 Replies

5. Red Hat

Named.conf file missing Centos 5.

hello everyone, I have install centos 5 recently.The file /etc/named.conf not found. I have installed BIND using yum. so now what to do ?? should i create named.conf file manually ??? please help me. thanks, sharlin. :) (1 Reply)
Discussion started by: sharlin
1 Replies

6. Shell Programming and Scripting

perl Compare zone files in directory with what is listed in named.conf

I would really appreciate any assistance that I can get here. I am fairly new to perl. I am trying to rewrite my shell scripts to perl. Currently I have a shell script (using sed, awk, grep, etc) that gets a list of all of the zone files in a directory and then looks in named.conf for what... (0 Replies)
Discussion started by: brianjb
0 Replies

7. Shell Programming and Scripting

[Solved] awk manipulation of sequentially named files

Hello, I am a very novice user of awk, I have a set of files named file001, file002, file003, file004, etc., each contains four fields (columns of data) separated each by a uneven number of spaces. I want to substitute those spaces by a TAB, so I am using this line of awk script: awk -v OFS="\t"... (4 Replies)
Discussion started by: jaldo0805
4 Replies

8. Shell Programming and Scripting

How to introduce the missing number sequentially?

Dear Help, I have an input file which looks like below 002 1000 2000 3000 003 2000 3000 4000 005 1000 2000 6000 I would like to have an output which inserts the missing number in sequential sorting as shown below... 001 0 0 0 002 1000 2000 3000 003 2000 3000 4000 004 0 0 0 005 1000... (5 Replies)
Discussion started by: Indra2011
5 Replies

9. Shell Programming and Scripting

Sequentially rename multiple files

Hello team, We wish to develop a script as follows : 1. Rename multiple files in the following way: example Original file names : test.txt and dummy.txt New file names : test.$(date +"%F").AAAAA<serialno_1>.BBBBBB.p and dummy.$(date +"%F").AAAAA<serialno_2>.BBBBBB.p 2. The... (3 Replies)
Discussion started by: H squared
3 Replies

10. UNIX for Beginners Questions & Answers

Finding Files with Perl on a Hidden Dir?

Greetings! Been a while since I futzed around with Perl, and came upon a minor headscratcher for the community ;) Here's the basic code which I'm trying to make tick over:#!/usr/bin/perl use strict; use warnings; use diagnostics; print " starting "; while (-e "~/.somedir/testFile")... (9 Replies)
Discussion started by: LinQ
9 Replies
RDF::Redland::Model(3pm)				User Contributed Perl Documentation				  RDF::Redland::Model(3pm)

NAME
RDF::Redland::Model - Redland RDF Model Class SYNOPSIS
use RDF::Redland; my $storage=new RDF::Redland::Storage("hashes", "test", "new='yes',hash-type='memory'"); my $model=new RDF::Redland::Model($storage, ""); ... my(@sources)=$model->targets($predicate_node, $object_node); ... DESCRIPTION
Manipulate the RDF model. CONSTRUCTORS
new STORAGE OPTIONS_STRING new_with_options STORAGE OPTIONS_HASH Create a new RDF::Redland::Model object using RDF::Redland::Storage object STORAGE with a options. The options can be given either as a string in the first form as OPTIONS_STRING. The options take the form key1='value1',key2='value2'. The quotes are required. In the second case OPTIONS_HASH is a reference to a Perl hash of options. new_from_model MODEL Create a new model from an existing RDF::Redland::Model MODEL (copy constructor). METHODS
size Return the size of the model (number of statements). sync Synchronise the model to the underlying storage. add SUBJECT PREDICATE OBJECT Add a new statement to the model with SUBJECT, PREDICATE and OBJECT. These can be RDF::Redland::Node, RDF::Redland::URI or perl URI objects. add_typed_literal_statement SUBJECT PREDICATE STRING [XML_LANGUAGE [DATATYPE]] Add a new statement to the model containing a typed literal string object STRING with (optional) XML language (xml:lang attribute) XML_LANGUAGE and (optional) datatype URI DATATYPE. XML_LANGUAGE or DATATYPE can either or both be set to undef. add_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT] Add RDF::Redland::Statement STATEMENT or the statement formed by NODE NODE NODE to the model. If the optional CONTEXT is given, associate it with that context. Any of NODE or CONTEXT can be a RDF::Redland::Node, RDF::Redland::URI or perl URI object. add_statements STREAM [CONTEXT] Add the statements from the RDF::Redland::Stream STREAM to the model. If the optional CONTEXT is given, associate it with that context. CONTEXT can be a RDF::Redland::Node, RDF::Redland::URI or perl URI object. remove_statement STATEMENT [CONTEXT] | NODE NODE NODE [CONTEXT] Remove RDF::Redland::Statement STATEMENT or the statement formed by NODE NODE NODE from the model. If the optional CONTEXT is given, remove only the statement stored with that context. Any of NODE or CONTEXT can be a RDF::Redland::Node, RDF::Redland::URI or perl URI object. remove_context_statements CONTEXT Remove all RDF::Redland::Statement STATEMENTs from the model with the given CONTEXT context. CONTEXT can be a RDF::Redland::Node, RDF::Redland::URI or perl URI object. contains_statement STATEMENT Return non 0 if the model contains RDF::Redland::Statement STATEMENT. as_stream [CONTEXT] Return a new RDF::Redland::Stream object seralising the entire model, or just those statements with CONTEXT, as RDF::Redland::Statement objects. If given, CONTEXT can be a RDF::Redland::Node, RDF::Redland::URI or perl URI object. find_statements STATEMENT [CONTEXT] Find all matching statements in the model matching partial RDF::Redland::Statement STATEMENT (any of the subject, predicate, object RDF::Redland::Node can be undef). If CONTEXT is given, finds statements only in that context. In an array context, returns an array of the matching RDF::Redland::Statement objects. In a scalar context, returns the RDF::Redland::Stream object representing the results. sources ARC TARGET Get all source RDF::Redland::Node objects for a given arc ARC, target TARGET> RDF::Redland::Node objects as a list of RDF::Redland::Node objects. arcs SOURCE TARGET Get all arc RDF::Redland::Node objects for a given source SOURCE, target TARGET RDF::Redland::Node objects as a list of RDF::Redland::Node objects. targets SOURCE ARC Get all target RDF::Redland::Node objects for a given source SOURCE, arc ARC RDF::Redland::Node objects as a list of RDF::Redland::Node objects. sources_iterator ARC TARGET Get all source RDF::Redland::Node objects for a given arc ARC, target TARGET RDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure. arcs_iterator SOURCE TARGET Get all arc RDF::Redland::Node objects for a given source SOURCE, target TARGET RDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure. targets_iterator SOURCE ARC Get all target RDF::Redland::Node objects for a given source SOURCE, arc ARC RDF::Redland::Node objects as an RDF::Redland::Iterator or undef on failure. source ARC TARGET Get one source RDF::Redland::Node object that matches a given arc ARC, target TARGET RDF::Redland::Node objects or undef if there is no match. arc SOURCE TARGET Get one arc RDF::Redland::Node object that matches a given source SOURCE, target TARGET RDF::Redland::Node objects or undef if there is no match. target SOURCE ARC Get one target RDF::Redland::Node object that matches a given source SOURCE, arc ARC RDF::Redland::Node objects or undef if there is no match. contexts Get all context RDF::Redland::Node objects in the model feature URI [VALUE] Get/set a model feature. The feature is named via RDF::Redland::URI URI and the value is a RDF::Redland::Node. If VALUE is given, the feature is set to that value, otherwise the current value is returned. query_execute QUERY Execute the QUERY RDF::Redland::Query against the model returning a result set RDF::Redland::QueryResults or undef on failure. load URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI [HANDLER ]]] Load content from URI into the model, guessing the parser. to_string [BASE-URI [SYNTAX-NAME [ MIME-TYPE [SYNTAX-URI]]] Serialize the model to a syntax. If no serializer name is given, the default serializer RDF/XML is used. OLDER METHODS
serialise serialize Return a new RDF::Redland::Stream object seralising the model as RDF::Redland::Statement objects. Replaced by as_stream to reduce confusion with the RDF::Redland::Serializer class. SEE ALSO
RDF::Redland::Storage, RDF::Redland::Node and RDF::Redland::Statement AUTHOR
Dave Beckett - http://www.dajobe.org/ perl v5.14.2 2011-02-04 RDF::Redland::Model(3pm)
All times are GMT -4. The time now is 06:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy