Sponsored Content
Full Discussion: comparing two tables
Top Forums Shell Programming and Scripting comparing two tables Post 302231355 by Franklin52 on Tuesday 2nd of September 2008 07:13:56 AM
Old 09-02-2008
Replace this line:

Code:
if [ "$col1"=="$col2" && "$len1"=="$len2" ]; then

with:

Code:
if [ "$col1" == "$col2" -a "$len1" == "$len2" ]; then

With Bash you can use the extended testcommand with double brackets:

Code:
if [[ "$col1" == "$col2" && "$len1" == "$len2" ]; then

Regards
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting tables of row data into columns of tables

I am trying to transpose tables listed in the format into format. Any help would be greatly appreciated. Input: test_data_1 1 2 90% 4 3 91% 5 4 90% 6 5 90% 9 6 90% test_data_2 3 5 92% 5 4 92% 7 3 93% 9 2 92% 1 1 92% ... Output:... (7 Replies)
Discussion started by: justthisguy
7 Replies

2. Shell Programming and Scripting

tables in scripts

Hi , I have two tables with same length t1 and t2, I want to cretae a new third table where i put the difference between the elements of t2 and t1, t3= t1 - t2 t3= t1 - t2 I am new to scripts, any help please? thanks (7 Replies)
Discussion started by: Celine19
7 Replies

3. Shell Programming and Scripting

Comparing rows in two tables and sending the differnce to mail

Hi, I have a table ,containg 2 coloumns and many rows,which is updated everyday.The no.of rows in the table changes everyday. i have to write the difference between yesterdays tabtle and todays table to a new file.The row that is new in the todays table need not to be shown.only the change... (2 Replies)
Discussion started by: bab123
2 Replies

4. Shell Programming and Scripting

Tables and borders

when i do this: cat HITS i get the following displayed: sport.hits:87.114.172.31 Thu Sep 28 22:45:12 GMT 2006 how do i put this information into a bordered table? so it will output like this: ...........File /... (9 Replies)
Discussion started by: amatuer_lee_3
9 Replies

5. Shell Programming and Scripting

Shell script for comparing data of tables

Hi, I have two databases with same tables on different servers.I need to check the data content in each table and if something is missing, should print that. I have a tool which takes the snapshot the table structure,index so on and compares with the other server tables snapshot. Now i need... (1 Reply)
Discussion started by: nessj
1 Replies

6. Shell Programming and Scripting

Show only new and removed records by comparing to MySQL tables

Hello all; I have been really frustrated with finding the correct perl code (and MySql statements) to accomplish what I thought was straight forward...I have tested I don't know how many different codes\suggestions I found on the net without any success...but anyhow let me explain my plight and... (0 Replies)
Discussion started by: gvolpini
0 Replies

7. Shell Programming and Scripting

Selecting tables

Hi, Can anyone help me that, How to see the table fields in Oracle database through shell script(ksh). I have tried with the following: sqlplus -s $user/$passwd@$sid << SQL >> session.log select * from Testtab.sql I'm not able to see anything.. Thanks (4 Replies)
Discussion started by: zxcjggu708
4 Replies

8. Shell Programming and Scripting

UPDATE COmmand post comparing 2 columns in 2 mysql tables

my queryis : select distinct m.name, item_count, item from master m join client p on m.name=p.name where item_count = 1 and item > 1; But how should I update them? i used update statetment : Update from client Set item =1 where m.name=p.name and item_count=1 AND item>1 Is this wrong? (1 Reply)
Discussion started by: siya@
1 Replies

9. Shell Programming and Scripting

Comparing two tables

I have defined a set of global variables at the beginning of my script as below: #ideal values export ITEM1=SUCCESS export ITEM2=FAILURE export ITEM3=UNAVAILABLE export ITEM5=FAILURE export ITEM6=SUCCESS now I have a shell script function which returns a value in below format. ITEM1... (1 Reply)
Discussion started by: ctrld
1 Replies

10. Shell Programming and Scripting

Compare with 2 tables

I have 3 file inputs, file1 20160302|5485368299953|96|510101223440252|USA|5485368299953|6|800|2300|0 20160530|5481379883742|7|510101242850814|USA|5481379883742|5|540|2181|1500 20160513|5481279653404|24|510100412142433|INDIA|5481279653404|3|380|1900|0... (1 Reply)
Discussion started by: radius
1 Replies
Font::TTF::Table(3pm)					User Contributed Perl Documentation				     Font::TTF::Table(3pm)

NAME
Font::TTF::Table - Superclass for tables and used for tables we don't have a class for DESCRIPTION
Looks after the purely table aspects of a TTF table, such as whether the table has been read before, locating the file pointer, etc. Also copies tables from input to output. INSTANCE VARIABLES
Instance variables start with a space read Flag which indicates that the table has already been read from file. dat Allows the creation of unspecific tables. Data is simply output to any font file being created. INFILE The read file handle OFFSET Location of the file in the input file LENGTH Length in the input directory CSUM Checksum read from the input file's directory PARENT The Font::TTF::Font that table is part of METHODS
Font::TTF::Table->new(%parms) Creates a new table or subclass. Table instance variables are passed in at this point as an associative array. $t->read Reads the table from the input file. Acts as a superclass to all true tables. This method marks the table as read and then just sets the input file pointer but does not read any data. If the table has already been read, then returns "undef" else returns $self $t->read_dat Reads the table into the "dat" instance variable for those tables which don't know any better $t->out($fh) Writes out the table to the font file. If there is anything in the "data" instance variable then this is output, otherwise the data is copied from the input file to the output $t->out_xml($context) Outputs this table in XML format. The table is first read (if not already read) and then if there is no subclass, then the data is dumped as hex data $t->XML_element Output a particular element based on its contents. $t->XML_end($context, $tag, %attrs) Handles the default type of <data> for those tables which aren't subclassed $t->dirty($val) This sets the dirty flag to the given value or 1 if no given value. It returns the value of the flag $t->update Each table knows how to update itself. This consists of doing whatever work is required to ensure that the memory version of the table is consistent and that other parameters in other tables have been updated accordingly. I.e. by the end of sending "update" to all the tables, the memory version of the font should be entirely consistent. Some tables which do no work indicate to themselves the need to update themselves by setting isDirty above 1. This method resets that accordingly. $t->empty Clears a table of all data to the level of not having been read $t->release Releases ALL of the memory used by this table, and all of its component/child objects. This method is called automatically by 'Font::TTF::Font->release' (so you don't have to call it yourself). NOTE, that it is important that this method get called at some point prior to the actual destruction of the object. Internally, we track things in a structure that can result in circular references, and without calling '"release()"' these will not properly get cleaned up by Perl. Once this method has been called, though, don't expect to be able to do anything with the "Font::TTF::Table" object; it'll have no internal state whatsoever. Developer note: As part of the brute-force cleanup done here, this method will throw a warning message whenever unexpected key values are found within the "Font::TTF::Table" object. This is done to help ensure that any unexpected and unfreed values are brought to your attention so that you can bug us to keep the module updated properly; otherwise the potential for memory leaks due to dangling circular references will exist. BUGS
No known bugs AUTHOR
Martin Hosken Martin_Hosken@sil.org. See Font::TTF::Font for copyright and licensing. perl v5.10.1 2009-01-21 Font::TTF::Table(3pm)
All times are GMT -4. The time now is 09:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy