record no.: 0
recordType: mtSMSRecord
serviceCentre: (91)8613800518500
servedIMSI: 460002343123147
servedIMEI: 358833002408050
servedMSISDN: (91)8613812341549
msClass: 3319A1
recordingEntity: (91)8613742148
location: LAC-51A8. CellID-1482
deliveryTime: 060905075847
systemType: gERAN
basicService: teleService(21)
additionalChgInfo: chargeIndicator-charge
chargedParty: calledParty
orgRNCorBSCId: 45 35
orgMSCId: 81 13
globalAreaID: 64 F0 00 51 A8 14 82
subscriberCategory: Common(A)
firstmccmnc: 64F000
smsUserDataType: FF
origination number: (91)8613675201877
callReference: 16 00 68 26 FA我只需要冒号后面的加入到数据库
想用
BULK INSERT dbo.table2
FROM 'E:\text\11.txt'
WITH (
FIELDTERMINATOR = ':',
ROWTERMINATOR = '\n'
)
这样会将所有的字段都加入,请教大家!
recordType: mtSMSRecord
serviceCentre: (91)8613800518500
servedIMSI: 460002343123147
servedIMEI: 358833002408050
servedMSISDN: (91)8613812341549
msClass: 3319A1
recordingEntity: (91)8613742148
location: LAC-51A8. CellID-1482
deliveryTime: 060905075847
systemType: gERAN
basicService: teleService(21)
additionalChgInfo: chargeIndicator-charge
chargedParty: calledParty
orgRNCorBSCId: 45 35
orgMSCId: 81 13
globalAreaID: 64 F0 00 51 A8 14 82
subscriberCategory: Common(A)
firstmccmnc: 64F000
smsUserDataType: FF
origination number: (91)8613675201877
callReference: 16 00 68 26 FA我只需要冒号后面的加入到数据库
想用
BULK INSERT dbo.table2
FROM 'E:\text\11.txt'
WITH (
FIELDTERMINATOR = ':',
ROWTERMINATOR = '\n'
)
这样会将所有的字段都加入,请教大家!
s : TStringList;
t : TStringList;
i : Integer;
begin
try
s := TStringList.Create;
s.Clear;
s.LoadFromFile('E:\text\11.txt');
t := TStringList.Create;
t.Clear;
for i := 0 to s.Count-1 do
begin
if Pos(':',S) then
begin
t.Add(s.Strings[i]);
end;
end;
//从T中读出写入到数据库就OK
方法类似,略
finally
s.Free;
t.Free;
end;
一共有30多万条这样的记录
想把它放到一张表中
record no.: 1
recordType: mtSMSRecord
serviceCentre: (91)8613800250543
servedIMSI: 460000832713755
servedIMEI: 357071005792270
servedMSISDN: (91)8613770839423
msClass: 331981
recordingEntity: (91)8613742148
location: LAC-51A8. CellID-1103
deliveryTime: 060905075847
systemType: gERAN
basicService: teleService(21)
additionalChgInfo: chargeIndicator-charge
chargedParty: calledParty
orgRNCorBSCId: 47 35
orgMSCId: 81 13
globalAreaID: 64 F0 00 51 A8 11 03
subscriberCategory: Common(A)
firstmccmnc: 64F000
smsUserDataType: 5
origination number: (A1)90022
callReference: 16 00 68 26 FB