equal
deleted
inserted
replaced
|
1 # Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # All rights reserved. |
|
3 # This component and the accompanying materials are made available |
|
4 # under the terms of "Eclipse Public License v1.0" |
|
5 # which accompanies this distribution, and is available |
|
6 # at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 # |
|
8 # Initial Contributors: |
|
9 # Nokia Corporation - initial contribution. |
|
10 # |
|
11 # Contributors: |
|
12 # |
|
13 # Description: |
|
14 # |
|
15 |
|
16 #!/usr/bin/perl |
|
17 |
|
18 $FilePath = "< add_simple_contacts.sql"; |
|
19 $FilePath2 = "> add_simple_contacts_dbms.sql"; |
|
20 open(SRC, $FilePath) or print STDERR "Cannot open $FilePath\n" and exit 1; |
|
21 create(DEST, $FilePath2) or print STDERR "Cannot open $FilePath2\n" and exit 1; |
|
22 my $Line; |
|
23 my $cnt = 0; |
|
24 while($Line = <SRC>) |
|
25 { |
|
26 if($Line =~ /^'\d\d\d\d-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2}',/) |
|
27 { |
|
28 print "$Line\n"; |
|
29 print DEST "#07/06/2006#,\n"; |
|
30 $cnt++; |
|
31 } |
|
32 else |
|
33 { |
|
34 if($Line =~ /x'.*',/) |
|
35 { |
|
36 @pair = split(/x/, $Line); |
|
37 print @pair[1]."\n"; |
|
38 print DEST @pair[1]."\n"; |
|
39 $cnt++; |
|
40 } |
|
41 else |
|
42 { |
|
43 print DEST $Line; |
|
44 } |
|
45 } |
|
46 } |
|
47 close(SRC); |
|
48 close(DEST); |
|
49 print "changed lines count: $cnt\n"; |
|
50 |