Sponsored Content
Full Discussion: Script asks to input data
Top Forums Shell Programming and Scripting Script asks to input data Post 302738803 by baris35 on Sunday 2nd of December 2012 10:36:13 PM
Old 12-02-2012
Quote:
Originally Posted by bipinajith
Is this homework?
hi,
I was graduated fifteen years ago Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Creation of Script to Input Separators in Data

Hi all, I have one problem that is preparing datas so I can run a script to extrat informations for my statistic reports. I receive some datas, that are informations mixed and I need to separate them to analyse. This is an exemple of datas:... (8 Replies)
Discussion started by: Alexis Duarte
8 Replies

2. Shell Programming and Scripting

Need script to take input from file, match on it in file 2 and input data

All, I am trying to figure out a script to run in windows that will allow me to match on First column in file1 to 8th Column in File2 then Insert file1 column2 to file2 column4 then create a new file. File1: 12345 Sam 12346 Bob 12347 Bill File2:... (1 Reply)
Discussion started by: darkoth
1 Replies

3. Shell Programming and Scripting

Reading passwd and need to use it multple times when script asks

Hi Gurus, I have one requirment.. I have written a script and it asks a registry passwd while performing some clearcase command. Now we are giving it manually. It's for one time run. We want to perform this for multiple times on multiple files throguh for loop.. means we need to pass the same... (3 Replies)
Discussion started by: raghu.iv85
3 Replies

4. Shell Programming and Scripting

Help to write a script or program to automatic execute and link input file data

Output file template format <input_file_name>a</input_file_name> <total_length_size>b</total_length_size> <log_10_length_size>c</log_10_length_size> Input_file_1 (eg. sample.txt) SDFSDGDGSFGRTREREYWW Parameter: a is equal to the input file name b is equal to the total length of... (2 Replies)
Discussion started by: perl_beginner
2 Replies

5. Shell Programming and Scripting

Echo date variable from data input to a script

Hi, I'm trying to make a script which you type the year, select the month and day and then create the date in the format 2010-12-7. #!/bin/bash dia () { echo " Seleccione el dia:" select file in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Salir do... (6 Replies)
Discussion started by: iga3725
6 Replies

6. Shell Programming and Scripting

adding data in input file if 2nd script output SUCCESS

Hi All, how can i edit my original data and add more data if my 2nd script outputs SUCESS? ex. input file: 1.txt nik,is,the 1script.sh if 2ndscript.sh output SUCCESS then i'm going to edit my input file and add data best,pogi.. sample outputdata. nik,is,the,best,pogi 2ndscript.sh... (3 Replies)
Discussion started by: nikki1200
3 Replies

7. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

8. Shell Programming and Scripting

Standardization of input source data files using shell script

Hi there, I'm a newbie in unix and am fishing for options related to how raw input data files are handled. The scenario, as I'm sure y'all must be very familiar with, is this : we receive upwards of 50 data files in ASCII format from various source systems - now each file has its own structure... (3 Replies)
Discussion started by: Prat Khos
3 Replies

9. UNIX for Dummies Questions & Answers

Inserting shell script input data automatically from a text file

Dear experts, I am new to linux programming. I have a shell script which i should run it on all my samples. I only define input and out put for this script. The inputs are 3 numbers(coordination numbers) which are available in a series of text file. Since i have a lots of samples, it takes a... (5 Replies)
Discussion started by: mohamadreza
5 Replies

10. Shell Programming and Scripting

How to get the shell script to read the .txt file as an input/data?

i have written my shell script in notepad however i am struggling to pass the data file to be read to the script the data file is of .txt format. My target is to run the shell script from the terminal and pass 3 arguments e.g. polg@DESKTOP-BVPDC5C:~/CS1420/coursework$ bash valsplit.sh input.txt... (11 Replies)
Discussion started by: Gurdza32
11 Replies
Easy(3pm)						User Contributed Perl Documentation						 Easy(3pm)

NAME
DBIx::Easy - Easy to Use DBI interface SYNOPSIS
use DBIx::Easy; my $dbi_interface = new DBIx::Easy qw(Pg template1); $dbi_interface -> insert ('transaction', id => serial ('transaction', 'transactionid'), time => $dbi_interface -> now); $dbi_interface -> update ('components', "table='ram'", price => 100); $rows_deleted = $dbi_interface -> delete ('components', 'stock = 0'); $dbi_interface -> makemap ('components', 'id', 'price', 'price > 10'); $components = $dbi_interface -> rows ('components'); $components_needed = $dbi_interface -> rows ('components', 'stock = 0'); DESCRIPTION
DBIx::Easy is an easy to use DBI interface. Currently the Pg, mSQL, mysql, Sybase, ODBC and XBase drivers are supported. CREATING A NEW DBI INTERFACE OBJECT
$dbi_interface = new DBIx::Easy qw(Pg template1); $dbi_interface = new DBIx::Easy qw(Pg template1 racke); $dbi_interface = new DBIx::Easy qw(Pg template1 racke aF3xD4_i); $dbi_interface = new DBIx::Easy qw(Pg template1 racke@linuxia.de aF3xD4_i); $dbi_interface = new DBIx::Easy qw(Pg template1 racke@linuxia.de:3306 aF3xD4_i); The required parameters are the database driver and the database name. Additional parameters are the database user and the password to access the database. To specify the database host use the USER@HOST notation for the user parameter. If you want to specify the port to connect to use USER@HOST:PORT. DESTROYING A DBI INTERFACE OBJECT
It is important that you commit all changes at the end of the interaction with the DBMS. You can either explicitly commit $dbi_interface -> commit (); or do it implicitly: undef $dbi_interface; ERROR HANDLING
sub fatal { my ($statement, $err, $msg) = @_; die ("$0: Statement "$statement" failed (ERRNO: $err, ERRMSG: $msg) "); } $dbi_interface -> install_handler (&fatal); If any of the DBI methods fails, either die will be invoked or an error handler installed with install_handler will be called. CACHING ISSUES
By default, this module caches table structures. This can be disabled by setting $DBIx::Easy::cache_structs to 0. XBASE DRIVER
The DBIx::Easy method rows fails to work with the DBD::XBase driver. METHODS
DATABASE ACCESS process statement $sth = $dbi_interface -> process ("SELECT * FROM foo"); print "Table foo contains ", $sth -> rows, " rows. "; Processes statement by just combining the prepare and execute steps of the DBI. Returns statement handle in case of success. insert table column value [column value] ... $sth = $dbi_interface -> insert ('bar', drink => 'Caipirinha'); Inserts the given column/value pairs into table. Determines from the SQL data type which values has to been quoted. Just pass a refer- ence to the value to protect values with SQL functions from quoting. update table conditions column value [column value] ... $dbi_interface -> update ('components', "table='ram'", price => 100); $dbi_interface -> update ('components', "table='ram'", price => "price + 20"); Updates any row of table which fulfill the conditions by inserting the given column/value pairs. Scalar references can be used to embed strings without further quoting into the resulting SQL statement. Returns the number of rows modified. put table conditions column value [column value] ... delete table conditions $dbi_interface -> delete ('components', "stock=0"); Deletes any row of table which fulfill the conditions. Without conditions all rows are deleted. Returns the number of rows deleted. rows table [conditions] $components = $dbi_interface -> rows ('components'); $components_needed = $dbi_interface -> rows ('components', 'stock = 0'); Returns the number of rows within table satisfying conditions if any. makemap table keycol valcol [condition] $dbi_interface -> makemap ('components', 'idf', 'price'); $dbi_interface -> makemap ('components', 'idf', 'price', 'price > 10'); $dbi_interface -> makemap ('components', 'idf', '*'); $dbi_interface -> makemap ('components', 'idf', '*', 'price > 10'); Produces a mapping between the values within column keycol and column valcol from table. If an condition is given, only rows matching this condition are used for the mapping. In order to get the hash reference to the record as value of the mapping, use the asterisk as the valcol parameter. random_row table conditions [map] Returns random row of the specified table. If map is set, the result is a hash reference of the selected row, otherwise an array refer- ence. If the table doesn't contains rows, undefined is returned. serial table sequence Returns a serial number for table by querying the next value from sequence. Depending on the DBMS one of the parameters is ignored. This is sequence for mSQL resp. table for PostgreSQL. mysql doesn't support sequences, but the AUTO_INCREMENT keyword for fields. In this case this method returns 0 and mysql generates a serial number for this field. fill sth hashref [flag column ...] Fetches the next table row from the result stored into sth and records the value of each field in hashref. If flag is set, only the fields specified by the column arguments are considered, otherwise the fields specified by the column arguments are omitted. view table [name value ...] foreach my $table (sort $dbi_interface -> tables) { print $cgi -> h2 ('Contents of ', $cgi -> code ($table)); print $dbi_interface -> view ($table); } Produces plain text representation of the database table table. This method accepts the following options as name/value pairs: columns: Which columns to display. order: Which column to sort the row after. limit: Maximum number of rows to display. separator: Separator inserted between the columns. where: Display only rows matching this condition. print $dbi_interface -> view ($table, order => $cgi -> param ('order') || '', where => "price > 0"); DATABASE INFORMATION is_table NAME Returns truth value if there exists a table NAME in this database. tables Returns list of all tables in this database. sequences Returns list of all sequences in this database (Postgres only). columns TABLE Returns list of the column names of TABLE. types TABLE Returns list of the column types of TABLE. sizes TABLE Returns list of the column sizes of TABLE. typemap TABLE Returns mapping between column names and column types for table TABLE. sizemap TABLE Returns mapping between column names and column sizes for table TABLE. TIME VALUES now $dbi_interface -> insert ('transaction', id => serial ('transaction', 'transactionid'), time => $dbi_interface -> now); Returns representation for the current time. Uses special values of the DBMS if possible. MONETARY VALUES money2num money Converts the monetary value money to a numeric one. MISCELLANEOUS is_auth_error msg This method decides if the error message msg is caused by an authentification error or not. AUTHORS
Stefan Hornburg (Racke), racke@linuxia.de Dennis Sch[:o]n, ds@1d10t.de Support for Sybase and ODBC provided by David B. Bitton <david@codenoevil.com>. VERSION
0.17 SEE ALSO
perl(1), DBI(3), DBD::Pg(3), DBD::mysql(3), DBD::msql(3), DBD::Sybase(3), DBD::ODBC(3). perl v5.8.8 2007-05-21 Easy(3pm)
All times are GMT -4. The time now is 11:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy