Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to insert smdr data to ms SQL server im already capturing the data by using putty telnet service and dum it to text it generates a file like
                                                            01/01/2020 PAGE 135
   CLASS  TIME DATE  LINE DURATION  STATION   DIALLED No./CLI  RD/COST ACCOUNT
01 PIN   09:07 01/01 004  00:00:14 107        0123456789       0:05              
02 PIN   09:08 01/01 002  00:00:08 107        0123456789       0:06              
03 PIN   09:10 01/01 001  00:00:11 107        0123456789       0:06              
04 POT   09:11 01/01 006  00:00:03 506        0123456789       
05 POT   09:12 01/01 006  00:00:00 506        0123456789       
06 PIN   09:13 01/01 016  00:00:13 107        0123456789       0:03              
07 PIN   09:17 01/01 009  00:00:29 107        0123456789       0:02              
08 POT   09:16 01/01 006  00:00:57 232        0123456789       
09 PIN   09:21 01/01 009  00:00:16 107        0123456789       0:12              
10 PIN   09:22 01/01 003  00:00:16 107        0123456789       0:09              
11 PIN   09:27 01/01 005  00:00:13 107        0123456789       0:06              
12 PIN   09:29 01/01 004  00:00:10 107        0123456789       0:20              
13 PIN   09:29 01/01 002  00:00:06 107        0123456789       0:20              
14 PIN   09:30 01/01 001                      0123456789       0:45    NO ANSWER 
15 PIN   09:30 01/01 006                      0123456789       0:49    NO ANSWER 
16 POT   09:31 01/01 009  00:00:15 232        0123456789                                
17 POT   09:31 01/01 006  00:00:58 232        0123456789       
18 PIN   09:39 01/01 003  00:00:08 107        0123456789       0:03              
19 PIN   09:39 01/01 005  00:00:08 107        0123456789       0:22              
20 PIN   09:40 01/01 002  00:00:08 107        0123456789       0:10              
21 PIN   09:39 01/01 004  00:00:03 107        0123456789       0:34              
22 PIN   09:41 01/01 001  00:00:09 107        0123456789       0:11              
23 PIN   09:41 01/01 010                      0123456789       0:25    NO ANSWER 
24 PIN   09:43 01/01 003  00:00:08 107        0123456789       0:12              
25 POT   09:44 01/01 006  00:00:09 506        0123456789       
26 PIN   09:45 01/01 005  00:00:12 107        0123456789       0:03              
27 PIN   09:45 01/01 002  00:01:08 107        0123456789       0:21              
28 PIN   09:51 01/01 004  00:00:12 107        0123456789       0:05              
29 POT   09:51 01/01 006  00:01:45 332        0123456789       
30 PIN   09:59 01/01 003  00:00:11 107        0123456789       0:04              
31 PIN   09:59 01/01 005  00:00:08 107        0123456789       0:23              
32 PIN   10:00 01/01 002  00:00:12 107        0123456789       0:08              
33 PIN   10:03 01/01 004  00:00:08 107        0123456789       0:05              
34 PIN   10:05 01/01 001  00:00:12 107        0123456789       0:06              
35 PIN   10:06 01/01 003  00:00:15 107        0123456789       0:13              
36 PIN   10:06 01/01 005  00:00:11 107        0123456789       0:29              
37 PIN   10:06 01/01 010                      0123456789       0:40    NO ANSWER 
38 PIN   10:07 01/01 002  00:00:11 107        0123456789       0:11              
39 PIN   10:07 01/01 011  00:00:10 107        0123456789       0:06              
40 PIN   10:14 01/01 004  00:00:34 107        0123456789       0:10              
41 PIN   10:14 01/01 001  00:00:29 107        0123456789       0:33              
42 PIN   10:15 01/01 003  00:00:27 107        0123456789       0:27              
43 PIN   10:17 01/01 005  00:00:30 107        0123456789       0:04              
44 POT   10:11 01/01 009  00:06:51 330        0123456789       
45 PIN   10:17 01/01 002  00:00:16 107        0123456789       0:36              
46 POT   10:11 01/01 006  00:07:25 330        0123456789                                
47 POT   10:16 01/01 010  00:03:20 102        0123456789       
48 POT   10:21 01/01 006  00:01:24 102        0123456789       
49 PIN   10:22 01/01 004  00:00:05 107        0123456789       0:07              
50 PIN   10:23 01/01 001  00:00:24 107        0123456789       0:09              
51 PIN   10:23 01/01 003  00:00:16 107        0123456789       0:28              
52 POT   10:22 01/01 009  00:02:01 337        0123456789       
53 POT   10:24 01/01 010  00:00:44 215        0123456789       
54 POT   10:22 01/01 006  00:02:31 102        0123456789       
55 POT   10:25 01/01 009  00:00:00 102        0123456789       










                                                            01/01/2020 PAGE 136
   CLASS  TIME DATE  LINE DURATION  STATION   DIALLED No./CLI  RD/COST ACCOUNT
01 POT   10:26 01/01 009  00:00:16 102        0123456789       
02 PIN   10:26 01/01 005                      0123456789       0:35    NO ANSWER 
03 PIN   10:26 01/01 002  00:00:23 107        0123456789       0:13              
04 POT   10:25 01/01 006  00:01:12 103        0123456789       
05 POT   10:26 01/01 009  00:01:04 214        0123456789       
06 PIN   10:27 01/01 004  00:00:28 107        0123456789       0:26              
07 PIN   10:30 01/01 001  00:00:17 107        0123456789       0:09              
08 PIN   10:30 01/01 003  00:00:10 107        0123456789       0:30              
09 PIN   10:32 01/01 002                      0123456789       0:47    NO ANSWER 
10 PIN   10:32 01/01 005                      0123456789       1:03    NO ANSWER 
11 POT   10:31 01/01 006  00:01:30 225        0123456789                         
12 POT   10:33 01/01 009  00:00:08 214        0123456789

I'm new to programming is anyone knows how to capture this data to msSQL

What I have tried:

[Duplicate post of above removed]
Posted
Updated 5-Mar-20 5:08am
v2
Comments
Richard MacCutchan 5-Mar-20 11:18am    
Yes, you read each line of data, split it into its separate fields and insert the fields that you want to save into your database through MySQL. Beyond that it is impossible to suggest anything.
Maciej Los 5-Mar-20 14:37pm    
Sounds like an answer!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900