Sponsored Content
Top Forums Shell Programming and Scripting Filter data in Excel sheet using Shell Script Post 302379065 by bhanusri83 on Wednesday 9th of December 2009 11:39:39 AM
Old 12-09-2009
Filter data in Excel sheet using Shell Script

Hi,

I have an excel sheet which has 100000 records. All these records are having 3 columns each with the last column as "Y" or "N". I would like to filter those records which has the value "Y". Can you please let me know how to proceed with that?

Thanks in advance.

-Sri

---------- Post updated at 11:39 AM ---------- Previous update was at 11:09 AM ----------

Any update on this
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to read the data from an excel sheet and use those data as variable in the unix c

I have 3 columns in an excel sheet. c1 c2 c3 EIP_ACCOUNT SMALL_TS_01 select A.* from acc; All the above 3 col shoud be passed a variable in the unix code. 1.How to read an excel file 2.How to pass these data as variable to the unic script (1 Reply)
Discussion started by: Anne Grace
1 Replies

2. Shell Programming and Scripting

How to update existing excel sheet using shell script

Hi All, I am having an excel sheet with pre-defined format which our business team specified, what i need to do is i have to write a script which need to pick values from database and update specified cells in excel sheet.. can any one please help me in this regard.. I am able to pull the... (3 Replies)
Discussion started by: balanarendra
3 Replies

3. Shell Programming and Scripting

Problem in formatting output of SQL query in excel sheet in shell script

Hi Guys.. Need your help to format the output of my shell script. I am using spool command to take out put in csv file. below is my code. (for example) col USERNAME for a15 col EMAIL for a30 col FULL_NAME for a20 col LAST_LOGIN for a40 col DATE_CREATED for a40 SPOOL 120.csv... (3 Replies)
Discussion started by: Agupte
3 Replies

4. Shell Programming and Scripting

a shell script to generate an excel sheet from a text file..

hi, i have a text file that looks like this! i want to generate an excel sheet out of it, removing all the junk data except the addresses that look like . Arrow Electrical Services Rotating Machinery, Electrical Contracting & Mining Specialists Onsite maintenance, breakdown... (8 Replies)
Discussion started by: vemkiran
8 Replies

5. Shell Programming and Scripting

Export data from database in Excel sheet with the help of Shell script and automated the report

Export data from database in Excel sheet with the help of Shell script and automated the report every day in the mornig. (1 Reply)
Discussion started by: neeraj617
1 Replies

6. UNIX for Dummies Questions & Answers

Load UNIX data into excel sheet

Hi, i have some data in a temporary file in Unix (the data is taken from the result of an SQL query). Now i want to dump that data into an excel sheet. How to do that. Someone please advise. Thanks Regards, Vinit (3 Replies)
Discussion started by: vinit raj
3 Replies

7. Shell Programming and Scripting

Save log data in excel sheet

Hello, I have the following data format in a log file : a : x1 b : x2 c : x3 d : x4 -------- a : x5 b : x6 c : x7 d : x8 so the same fields ( a ,b ,c,d) repeated many times in the same log file but with different "x" values (x5,x6,x7,x8). I need a script to save this data in an... (6 Replies)
Discussion started by: mm00123
6 Replies

8. Shell Programming and Scripting

Adding tab to excel sheet with shell script

(1 Reply)
Discussion started by: sagar_1986
1 Replies

9. Shell Programming and Scripting

Shell Script for copying text file to Excel Sheet

Hi, I want to write a program to copy a log file to Excel sheet. Excel sheet has four columns MethodName , Code , Description, Details and Time. I want to pick these info from text file and put it in excel sheet. here is how the text file looks - 04.17.2014 08:06:12,697... (1 Reply)
Discussion started by: hershey
1 Replies

10. Shell Programming and Scripting

Summing up the data from different excel sheet into one excel sheet

Hi Folks, Can you please advise for any script in unix such that for example , i have 3 different excel sheet at the location /ppt/gfr/exc so the name s of the excel sheet are 1excel.xslx 2excel.xslx 3excel.xslx now in these 3 different excel sheet there is lot of data for example each... (3 Replies)
Discussion started by: punpun66
3 Replies
NetSDS::DBI::Table(3pm) 				User Contributed Perl Documentation				   NetSDS::DBI::Table(3pm)

NAME
NetSDS::DBI::Table SYNOPSIS
use NetSDS::DBI::Table; my $q = NetSDS::DBI::Table->new( dsn => 'dbi:Pg:dbname=netsdsdb;host=127.0.0.1', user => 'netsds', passwd => 'test', table => 'public.messages', ) or warn NetSDS::DBI::Table->errstr(); DESCRIPTION
"NetSDS::DBI::Table" module provides commonly used CRUD functionality for data stored in single database. Main idea was that we can agree about some limitations: * every such table contains "id" field that is primary key * we use PostgreSQL DBMS with all it's features CLASS API
new([...]) - class constructor my $tbl = NetSDS::DBI::Table->new( dsn => 'dbi:Pg:dbname=content', login => 'netsds', passwd => 'topsecret, table => 'content.meta', ); fetch(%params) - get records from table as array of hashrefs Paramters (hash): * fields - fetch fields by list * filter - arrayref of SQL expressions like "status = 'active'" for "WHERE" clause * order - arrayref of SQL expressions like "id desc" for "ORDER BY" clause * limit - max number of records to fetch (LIMIT N) * offset - records to skip from beginning (OFFSET N) * for_update - records selected for further update within current transaction Returns: message as array of hashrefs Sample: my @messages = $q->fetch( fields => ['id', 'now() as time'], filter => ['msg_status = 5', 'date_received < now()'], # where msg_status=5 and date_received < now() order => ['id desc', 'src_addr'], # order by id desc, src_addr limit => 3, # fetch 3 records offset => 5, # from 6-th record for_update => 1, # for update ) insert_row(%key_val_pairs) - insert record into table Paramters: record fields as hash Returns: id of inserted record my $user_id = $tbl->insert_row( 'login' => 'vasya', 'password' => $encrypted_passwd, ); insert(@records_list) - mass insert Paramters: list of records (as hashrefs) Returns: array of inserted records "id" This method allows mass insert of records. my @user_ids = $tbl->insert( { login => 'vasya', password => $str1 }, { login => 'masha', password => $str2 }, { login => 'petya', password => $str3, active => 'false' }, ); Warning! This method use separate INSERT queries and in fact is only wrapper for multiple "insert_row()" calls. So it's not so fast as one insert but allows to use different key-value pairs for different records. update_row($id, %params) - update record parameters Paramters: id, new parameters as hash Returns: updated record as hash Example: my %upd = $table->update_row($msg_id, status => 'failed', dst_addr => '380121234567', ); After this %upd hash will contain updated table record. update(%params) - update records by filter Paramters: filter, new values $tbl->update( filter => ['active = true', 'created > '2008-01-01'], set => { info => 'Created after 2007 year', } ); get_count(%params) - retrieve number of records Just return total number of records by calling: # SELECT COUNT(id) FROM schema.table my $count = $tbl->get_count(); my $count_active = $tbl->get_count(filter => ['active = true']); delete_by_id(@ids) - delete records by identifier Paramters: list of record id Returns: 1 if ok, undef if error Method deletes records from SQL table by it's identifiers. if ($tbl->remove(5, 8 ,19)) { print "Records successfully removed."; } delete(@filters) - delete records Paramters: list of filters Returns: 1 if ok, undef if error $tbl->delete( 'active = false', 'expire < now()', ); get_fields() - get list of fields Example: my @fields = @{ $tbl->get_fields() }; print "Table fields: " . join (', ', @fields); has_field($field) - check if field exists Paramters: field name Example: if ($tbl->has_field('uuid')) { $tbl->call("delete tbldata where uuid=?", $uuid); } NOTE: this method works only for restricted tables that use "fields" parameter at construction time. EXAMPLES
See "samples/test_db_table.pl" script BUGS
Bad documentation SEE ALSO
NetSDS::DBI <http://en.wikipedia.org/wiki/Create,_read,_update_and_delete> TODO
None AUTHOR
Michael Bochkaryov <misha@rattler.kiev.ua> LICENSE
Copyright (C) 2008-2009 Net Style Ltd. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA perl v5.10.1 2010-04-28 NetSDS::DBI::Table(3pm)
All times are GMT -4. The time now is 10:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy