08-05-2009
If performance is a consideration then perl is probably not a good approach. If your data is in a database table, which you are already alluding to, then you need a smart use of the LIKE operator as well as wildcards ('%', '_' etc). Details of what is possible within MySQL can be found here:
MySQL :: MySQL 5.0 Reference Manual :: 11.4.1 String Comparison Functions
Let me know what you ultimately will use, because I find the problem quite interesting.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I'm new of UNIX shell scripting. I'm recently generating a excel report in UNIX(file with delimiter is fine). How should I make a script to do it?
1 file to join comes from output of one UNIX command, the second from another UNIX command, and third from a database query. The key columes of all... (7 Replies)
Discussion started by: bigsmile
7 Replies
2. Shell Programming and Scripting
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Discussion started by: Katabatic
1 Replies
3. Shell Programming and Scripting
So I have 2 files:
File 1:
111,Mike,Stipe
222,Peter,Buck
333,Mike,Mills
File 2:
222,Mr,Bono
444,Mr,Edge
I want output to be below, where 222 records joined and all none joined records still in output
111,Mike,Stipe
222,Peter,Buck,Mr,Bono
333,Mike,Mills
444,Mr,Edge (4 Replies)
Discussion started by: stack
4 Replies
4. Shell Programming and Scripting
Hello,
I have a directory with allot of tab delimited text files that have data that look like,
filePath distance
(1,4-dioxan-2-ylmethyl)methylamine 0.0
4-methylmorpholine 0.0755473632594
1-propyl-4-piperidone 0.157792911954
heptaminol 0.158142893249
N-acetylputrescine 0.158689628956... (3 Replies)
Discussion started by: LMHmedchem
3 Replies
5. Shell Programming and Scripting
Hi,
I have a file pk.txt which has pk data in following format
TableName | PK
Employee | id
Contact|name,country
My Output should be
Employee | t1.id=s.id
Contact| t1.name=s.name AND t1.country=s.country
I started of like this:
for LIST in `cat pk.txt` do... (5 Replies)
Discussion started by: wahi80
5 Replies
6. Shell Programming and Scripting
Hi,
I am trying to join 2 csv files, to create a 3rd output file with the joined data.
Below is an example of my Input Data:
Input File 1
NAME, FAV_FOOD, FAV_DRINK, ID, GENDER
Bob, Fish, Coke, 1, M
Lisa, Rice, Water, 2, F
Jenny, Noodle, Tea, 3, F
Ken, Pizza, Coffee, 4, M
Lisa,... (7 Replies)
Discussion started by: RichZR
7 Replies
7. Shell Programming and Scripting
Hello,
I have 2 csv as follows:
a.csv:
name,phone,adress,car
xy,1234,asbd
yz,2134,asbdf
tc,6789,salkdur
b.csv:
telphone,vehicle
2134,toyota
6789,bmw
1234,honda
What is need is this:
output.csv:
name,phone,adres,car
xy,1234,asbd,honda
yz,2134,asbdf,toyota (7 Replies)
Discussion started by: Zam_1234
7 Replies
8. Shell Programming and Scripting
Join and merge multiple files with duplicate key and fill void columns
Hi guys,
I have many files that I want to merge:
file1.csv:
1|abc
1|def
2|ghi
2|jkl
3|mno
3|pqr
file2.csv: (5 Replies)
Discussion started by: yjacknewton
5 Replies
LEARN ABOUT LINUX
ndb_delete_all
NDB_DELETE_ALL(1) MySQL Database System NDB_DELETE_ALL(1)
NAME
ndb_delete_all - delete all rows from an NDB table
SYNOPSIS
ndb_delete_all options
DESCRIPTION
ndb_delete_all deletes all rows from the given NDB table. In some cases, this can be much faster than DELETE or even TRUNCATE TABLE.
Usage
ndb_delete_all -c connect_string tbl_name -d db_name
This deletes all rows from the table named tbl_name in the database named db_name. It is exactly equivalent to executing TRUNCATE
db_name.tbl_name in MySQL.
The following table includes options that are specific to ndb_delete_all. Additional descriptions follow the table. For options common to
most MySQL Cluster programs (including ndb_delete_all), see Options Common to MySQL Cluster Programs(1).
Table 17.16. ndb_delete_all Options and Variables: MySQL Cluster NDB 7.2
+--------------------------+-----------------------------------+-------------------------------------+
|Format | Description | Added / Removed |
+--------------------------+-----------------------------------+-------------------------------------+
| | Name of the database in which the | |
| --database=dbname, | table is found | All MySQL 5.5 based releases |
| | | |
| -d | | |
+--------------------------+-----------------------------------+-------------------------------------+
| | Perform the delete in a single | |
| --transactional, | transaction (may run out of | All MySQL 5.5 based releases |
| | operations) | |
| -t | | |
+--------------------------+-----------------------------------+-------------------------------------+
| | Run tup scan | |
| --tupscan | | All MySQL 5.5 based releases |
+--------------------------+-----------------------------------+-------------------------------------+
| | Run disk scan | |
| --diskscan | | All MySQL 5.5 based releases |
+--------------------------+-----------------------------------+-------------------------------------+
o --transactional, -t
Use of this option causes the delete operation to be performed as a single transaction.
Warning
With very large tables, using this option may cause the number of operations available to the cluster to be exceeded.
COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as
published by the Free Software Foundation; version 2 of the License.
This documentation 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 the program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/.
SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online
at http://dev.mysql.com/doc/.
AUTHOR
Oracle Corporation (http://dev.mysql.com/).
MySQL 5.5 01/30/2014 NDB_DELETE_ALL(1)