CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Process MYSQL dump FILE

 



doug1707
New User

Dec 18, 2012, 9:56 PM

Post #1 of 2 (823 views)
Process MYSQL dump FILE Can't Post

Hello !!!

It's been a long time since I programmed in Perl.. and starting over again.

I have a file which is the output of MySQL Dump.. it looks like

MySQL dump 10.13 Distrib 5.1.63, for debian-linux-gnu (x86_64)
INSERT INTO `ACCOUNTING_ARCHIVE` VALUES ('name@g.net.au',1291125601,'Start',6,NULL,NULL,'FF10FFFF5800B09B-4C
F5035A',NULL,NULL,'123.2.2.116','2432741531','123.3.225.194',NULL,'N',NULL,NULL),('weee@gwww.com',1291125603,'Stop'
,1,2757,15142,'FF10FFFF58005032-4CF500F3',623,2,'123.2.2.116','2432716850','123.3.225.154',NULL,'N',NULL,NULL),

I would like to grab all the text between "(" and ")" and put that to a single record in another file

Regards

Doug


Laurent_R
Veteran / Moderator

Dec 18, 2012, 11:23 PM

Post #2 of 2 (821 views)
Re: [doug1707] Process MYSQL dump FILE [In reply to] Can't Post

Something like this should capture whatever is between parens in your string:


Code
my $value = $1 if $dump =~ /\(([^)])\)/;


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives