10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
OS : RHEL 6.8
Shell : bash
I want to remove all lines like below from the history output as it has password.
$ history | grep sqlplus
239 sqlplus jn_usr/dxc825#@10.5.12.106/OCSGPD
256 sqlplus osb_soa/KD1egM09@10.5.12.196/BSOAPRD
279 sqlplus jn_usr/dxc825#@10.80.16.219/OCSGPD... (5 Replies)
Discussion started by: John K
5 Replies
2. UNIX for Beginners Questions & Answers
HI Folks -
I'm very frustrated - I'm trying to execute a verys imple for loop and rename the files if they exist.
here is my loop :
ydate=`TZ=aaa24 date +%m%d`
CR_YR=$(date "+%Y")
echo $ydate
echo ${CR_YR}
cd... (6 Replies)
Discussion started by: SIMMS7400
6 Replies
3. Shell Programming and Scripting
Hi,
i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues.
Src file(jjj.txt)
-------... (8 Replies)
Discussion started by: raju2016
8 Replies
4. UNIX for Beginners Questions & Answers
I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I'm using cygwin on my Windows 7 machine.
From the man pages of cut:
--output-delimiter=STRING
use STRING as the output delimiter the default is to use the input delimiter
I tried the following commands and got the error messages:
$ cut -c1-10,20-30 -d... (10 Replies)
Discussion started by: kojac
10 Replies
6. Shell Programming and Scripting
Hi
Can anyone what I am doing wrong while using cut command.
for f in *.log
do
logfilename=$f
Log "Log file Name: $logfilename"
logfile1=`basename $logfilename .log`
flength=${#logfile1}
Log "file length $flength"
from_length=$(($flength - 15))
Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies
7. UNIX for Dummies Questions & Answers
Hi Forum
Im having problem with cut it even when i cut a field from an input file
eg
echo $x | cut -f1 -d':'
it doesnt read the whole line if there is a space in it
eg
thisLineHasA SpaceInIt
:wall:
it only read up to the space.What i want is so the it cut the field as one line ... (8 Replies)
Discussion started by: ShinTec
8 Replies
8. Shell Programming and Scripting
how to traverse through each directory (1 Reply)
Discussion started by: Reddy482
1 Replies
9. UNIX for Dummies Questions & Answers
I have a function "MyPrint" that runs great on a file (BaseData.txt) that has one line of data. If i add rows to the text file it's reading the tFile variable becomes a list of every field 2 in the file. To correct this, i tried to call the function from a loop where i read one line at a time and... (4 Replies)
Discussion started by: KME
4 Replies
10. Shell Programming and Scripting
Hi,
In the following bash code rather than cutting at a predefined character I would like to cut at position i (i var from loop).
Is this possible? I have tried eval, but either it's not possible or my syntax is wrong.
thanks
Nick
for i in {1..9}
do
theChar=$(echo... (3 Replies)
Discussion started by: de_la_espada
3 Replies
Excel(3pm) User Contributed Perl Documentation Excel(3pm)
NAME
DBD::Excel - A class for DBI drivers that act on Excel File.
This is still alpha version.
SYNOPSIS
use DBI;
$hDb = DBI->connect("DBI:Excel:file=test.xls")
or die "Cannot connect: " . $DBI::errstr;
$hSt = $hDb->prepare("CREATE TABLE a (id INTEGER, name CHAR(10))")
or die "Cannot prepare: " . $hDb->errstr();
$hSt->execute() or die "Cannot execute: " . $hSt->errstr();
$hSt->finish();
$hDb->disconnect();
DESCRIPTION
This is still alpha version.
The DBD::Excel module is a DBI driver. The module is based on these modules:
* Spreadsheet::ParseExcel
reads Excel files.
* Spreadsheet::WriteExcel
writes Excel files.
* SQL::Statement
a simple SQL engine.
* DBI
Of course. :-)
This module assumes TABLE = Worksheet. The contents of first row of each worksheet as column name.
Adding that, this module accept temporary table definition at "connect" method with "xl_vtbl".
ex.
my $hDb = DBI->connect(
"DBI:Excel:file=dbdtest.xls", undef, undef,
{xl_vtbl =>
{TESTV =>
{
sheetName => 'TEST_V',
ttlRow => 5,
startCol => 1,
colCnt => 4,
datRow => 6,
datLmt => 4,
}
}
});
For more information please refer sample/tex.pl included in this distribution.
Metadata
The following attributes are handled by DBI itself and not by DBD::Excel, thus they all work like expected:
Active
ActiveKids
CachedKids
CompatMode (Not used)
InactiveDestroy
Kids
PrintError
RaiseError
Warn (Not used)
The following DBI attributes are handled by DBD::Excel:
AutoCommit
Always on
ChopBlanks
Works
NUM_OF_FIELDS
Valid after "$hSt->execute"
NUM_OF_PARAMS
Valid after "$hSt->prepare"
NAME
Valid after "$hSt->execute"; undef for Non-Select statements.
NULLABLE
Not really working, always returns an array ref of one's. Valid after "$hSt->execute"; undef for Non-Select statements.
These attributes and methods are not supported:
bind_param_inout
CursorName
LongReadLen
LongTruncOk
Additional to the DBI attributes, you can use the following dbh attribute:
xl_fmt
This attribute is used for setting the formatter class for parsing.
xl_dir
This attribute is used only with "data_sources" on setting the directory where Excel files ('*.xls') are searched. It defaults to the
current directory (".").
xl_vtbl
assumes specified area as a table. See sample/tex.pl.
xl_skiphidden
skip hidden rows(=row height is 0) and hidden columns(=column width is 0). See sample/thidden.pl.
xl_ignorecase
set casesensitive or not about table name and columns. Default is sensitive (maybe as SQL::Statement). See sample/thidden.pl.
Driver private methods
data_sources
The "data_sources" method returns a list of '*.xls' files of the current directory in the form "DBI:Excel:xl_dir=$dirname".
If you want to read the subdirectories of another directory, use
my($hDr) = DBI->install_driver("Excel");
my(@list) = $hDr->data_sources(
{ xl_dir => '/usr/local/xl_data' } );
list_tables
This method returns a list of sheet names contained in the $hDb->{file}. Example:
my $hDb = DBI->connect("DBI:Excel:file=test.xls");
my @list = $hDb->func('list_tables');
TODO
More tests
First of all...
Type and Format
The current version not support date/time and text formating.
Joins
The current version of the module works with single table SELECT's only, although the basic design of the SQL::Statement module allows
joins and the likes.
KNOWN BUGS
o There are too many TODO things. So I can't determind what is BUG. :-)
AUTHOR
Kawai Takanori (Hippo2000) kwitknr@cpan.org
Homepage:
http://member.nifty.ne.jp/hippo2000/ (Japanese)
http://member.nifty.ne.jp/hippo2000/index_e.htm (English)
Wiki:
http://www.hippo2000.net/cgi-bin/KbWiki/KbWiki.pl (Japanese)
http://www.hippo2000.net/cgi-bin/KbWikiE/KbWiki.pl (English)
SEE ALSO
DBI, Spreadsheet::WriteExcel, Spreadsheet::ParseExcel, SQL::Statement
COPYRIGHT
Copyright (c) 2001 KAWAI,Takanori All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
perl v5.8.8 2008-03-01 Excel(3pm)