I have a problem with the script below
#!/bin/sh
for vo in `find -maxdepth 1 -type f -regex "^\./*$"`
do
ls -l "$vo"
some other commands
done
It works fine until `find ...` returns files with spaces. I've tryed to change IFS but haven't succeed
Any solutions? (4 Replies)
Hi,
To start, I am using a bash shell on a G4 powerbook running Leopard. I am attempting to write a shell script that will automate the processing of satellite imagery. All the filenames are of the following construction:
A2008196000500.L2
where A indicates the sensor, the next four... (6 Replies)
HIya,
Having a dumb day whilst writing an archive process in Shell want to extract from the filename the date and archive into tar files based on this, I don't want to use mtime as it may not be the actual file date.
The files are
-rw-rw---- 1 user admin 100 Aug 29 11:10... (2 Replies)
Using a small script, I automatically generated some text logs. The files ended being undownloadable, unopenable and undeletable. Upon further investigation, the files ended up looking like this:
log\r
log2\r
log3\r
I've tried a few different things, including double slashing before the... (6 Replies)
How can I loose a part of the filename
I want to drop the “_<Number>.sql”
Below I have a listing of file names in a file
Eg :
CREDIT_DEL_033333.sql I want it to be CREDIT_DEL
ATM_DEBIT_CARD_0999999.sql I want it to be ... (3 Replies)
I have 7 files with 7 different names coming into a specified folder on weekly basis, i need to pick a file one after another and load into oracle table using sql loader. I am using ksh to do this. So in the process if the file has error records and if sql loader fails to load into oracle tables,... (0 Replies)
Hi Folks,
I'm looking for some ideas on how to change some file names. I'm pretty sure I need to use sed or awk but they still escape me. The files I have are like:
VOD0615 NEW Blades R77307.pdf or
VOD0615_NEW_Blades_R77307.pdf
and what I want after processing is:
R77307 NEW Blades.pdf
... (5 Replies)
Hi:
mkisofs -graft-points -rational-rock -joliet -joliet-long -full-iso9660-filenames -iso-level 2 -o /tmp/image.iso STORE1/=/almacen/strauss
In /almacen/strauss there are filenames containing not only spaces but accented characters as well. I burned the image to DVD, with the result that all... (2 Replies)
Hi there
I have thousands files like:
SG1130113000247.CAPNFXS
SG1130113001247.CAPNFXT
SG1130113002247.CAPNFXU
.
.
.
I want to remove SG1 and .CAP* from file name, and rename it to:
130113000247
130113001247
130113002247 (9 Replies)
Hello Unix experts:
I have dir where few files are there, i want to sort these files and write the output to some other file but i need filenames with filepath too
eg:
i have filenames like
010020001_S-FOR-Sort-SYEXC_20171218_094256_0004.txt
so i want to sort my files on first 5 fields of... (2 Replies)
Discussion started by: gnnsprapa
2 Replies
LEARN ABOUT DEBIAN
class::dbi::loader
Class::DBI::Loader(3pm) User Contributed Perl Documentation Class::DBI::Loader(3pm)NAME
Class::DBI::Loader - Dynamic definition of Class::DBI sub classes.
SYNOPSIS
use Class::DBI::Loader;
my $loader = Class::DBI::Loader->new(
dsn => "dbi:mysql:dbname",
user => "root",
password => "",
options => { RaiseError => 1, AutoCommit => 0 },
namespace => "Data",
additional_classes => qw/Class::DBI::AbstractSearch/, # or arrayref
additional_base_classes => qw/My::Stuff/, # or arrayref
left_base_classes => qw/Class::DBI::Sweet/, # or arrayref
constraint => '^foo.*',
relationships => 1,
options => { AutoCommit => 1 },
inflect => { child => 'children' },
require => 1
);
my $class = $loader->find_class('film'); # $class => Data::Film
my $obj = $class->retrieve(1);
use with mod_perl
in your startup.pl
# load all tables
use Class::DBI::Loader;
my $loader = Class::DBI::Loader->new(
dsn => "dbi:mysql:dbname",
user => "root",
password => "",
namespace => "Data",
);
in your web application.
use strict;
# you can use Data::Film directly
my $film = Data::Film->retrieve($id);
DESCRIPTION
Class::DBI::Loader automate the definition of Class::DBI sub-classes. scan table schemas and setup columns, primary key.
class names are defined by table names and namespace option.
+-----------+-----------+-----------+
| table | namespace | class |
+-----------+-----------+-----------+
| foo | Data | Data::Foo |
| foo_bar | | FooBar |
+-----------+-----------+-----------+
Class::DBI::Loader supports MySQL, Postgres and SQLite.
See Class::DBI::Loader::Generic.
METHODS
new %args
additional_base_classes
List of additional base classes your table classes will use.
left_base_classes
List of additional base classes, that need to be leftmost, for example Class::DBI::Sweet (former Catalyst::Model::CDBI::Sweet).
additional_classes
List of additional classes which your table classes will use.
constraint
Only load tables matching regex.
exclude
Exclude tables matching regex.
debug
Enable debug messages.
dsn DBI Data Source Name.
namespace
Namespace under which your table classes will be initialized.
password
Password.
options
Optional hashref to specify DBI connect options
relationships
Try to automatically detect/setup has_a and has_many relationships.
inflect
An hashref, which contains exceptions to Lingua::EN::Inflect::PL(). Useful for foreign language column names.
user
Username.
require
Attempt to require the dynamically defined module, so that extensions defined in files. By default errors from imported modules are
suppressed. When you want to debug, use require_warn.
require_warn
Warn of import errors when requiring modules.
AUTHOR
Daisuke Maki "dmaki@cpan.org"
AUTHOR EMERITUS
Sebastian Riedel, "sri@oook.de" IKEBE Tomohiro, "ikebe@edge.co.jp"
THANK YOU
Adam Anderson, Andy Grundman, Autrijus Tang, Dan Kubb, David Naughton, Randal Schwartz, Simon Flack and all the others who've helped.
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Class::DBI, Class::DBI::mysql, Class::DBI::Pg, Class::DBI::SQLite, Class::DBI::Loader::Generic, Class::DBI::Loader::mysql,
Class::DBI::Loader::Pg, Class::DBI::Loader::SQLite
perl v5.10.0 2007-03-22 Class::DBI::Loader(3pm)