Home > Back-end >  How to extract the content in the data
How to extract the content in the data

Time:09-20

I have a data content as follows:
The key information

Quick query: service number [15245933384130167622152618853], [2015-01-15 00:00:00] start time, end time 10:35:40 [2015-07-15], the search scope: [telecom user data: mobile, unicom, telecom] [main materials: mobile, unicom, telecom] query: anda



I want to put the above content is split into like this, how can I be

Key information service number query why
[telecom user data: mobile, unicom, telecom] 15245933384 anda
[telecom user data: mobile, unicom, telecom] 13091676622 anda
[telecom user data: mobile, unicom, telecom] 15246188853 anda
[main materials: mobile, unicom, telecom] 15245933384 anda
[main materials: mobile, unicom, telecom] 13091676622 anda
[main materials: mobile, unicom, telecom] 15246188853 anda

CodePudding user response:

Use string functions, pos and copy and dismantling, Delphi and SQL

CodePudding user response:

Problem is the service number is not fixed, it is possible that a, also may be two, or three

CodePudding user response:

You according to the service number ', 'the interception, cycle in the stringlist

CodePudding user response:

Complex text should use regular expressions to intercept,

CodePudding user response:

This is a basic string handling functions, have to fumble, learn about the function of the string, take time to look at will,

Recommend treatment in DELPHI, detailed records cycle split

CodePudding user response:

Remove the [], the string assigned to stringList, then use the stringList value directly,

Var
The List: TStringList;
The begin
List:=TStringList. Create;
List.Com maText:='aaa, BBB, CCC and DDD';
ShowMessage (List [0]);//aaa
List. Free;
end;
  • Related