sl@0: # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: # All rights reserved. sl@0: # This component and the accompanying materials are made available sl@0: # under the terms of "Eclipse Public License v1.0" sl@0: # which accompanies this distribution, and is available sl@0: # at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: # sl@0: # Initial Contributors: sl@0: # Nokia Corporation - initial contribution. sl@0: # sl@0: # Contributors: sl@0: # sl@0: # Description: sl@0: # sl@0: sl@0: #!/usr/bin/perl sl@0: sl@0: $FilePath = "< add_simple_contacts.sql"; sl@0: $FilePath2 = "> add_simple_contacts_dbms.sql"; sl@0: open(SRC, $FilePath) or print STDERR "Cannot open $FilePath\n" and exit 1; sl@0: create(DEST, $FilePath2) or print STDERR "Cannot open $FilePath2\n" and exit 1; sl@0: my $Line; sl@0: my $cnt = 0; sl@0: while($Line = ) sl@0: { sl@0: if($Line =~ /^'\d\d\d\d-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}',/) sl@0: { sl@0: print "$Line\n"; sl@0: print DEST "#07/06/2006#,\n"; sl@0: $cnt++; sl@0: } sl@0: else sl@0: { sl@0: if($Line =~ /x'.*',/) sl@0: { sl@0: @pair = split(/x/, $Line); sl@0: print @pair[1]."\n"; sl@0: print DEST @pair[1]."\n"; sl@0: $cnt++; sl@0: } sl@0: else sl@0: { sl@0: print DEST $Line; sl@0: } sl@0: } sl@0: } sl@0: close(SRC); sl@0: close(DEST); sl@0: print "changed lines count: $cnt\n"; sl@0: