问题描述
我有一个包含日志条目的表。
该表有两列,第一列是时间戳,第二列包含我需要解析的数据。我要做的是将第二列中的三个字段分成三列。
以下是第二列中两行数据的示例;
(TA:606:ItemId的重复条目SerialId ModelNo [12350901] [123456086632509] [2016])
(TA:606:ItemId的重复条目SerialId ModelNo [45685470] [957125352146255] [14 ])
我对Access 2000不是太熟悉了,但是我正在尝试使用带有左右功能的instr来提取论坛。对我来说效果不好。
我认为括号是问题....
只要数据要解析的内容仍然在括号([])中,并且在数据元素之间和第三个元素的末尾存在单个空格,那么它就变得相当简单。假设第二列位于名为[Field_Test]的字段中,该字段位于名为tblTest的表中,则它将成为一个带有三个计算字段的查询,调用3个简单函数:
I have a table that contains log entries.
The table has two columns, the first column is a timestamp and the second column contains the data I need to parse. What I have to do is seperate the three fields in the second column into three columns.
Here is an example of two rows of data from the second column;
(TA:606:Duplicate Entry For ItemId SerialId ModelNo [12350901] [123456086632509] [2016] )
(TA:606:Duplicate Entry For ItemId SerialId ModelNo [45685470] [957125352146255] [14] )
I am not too familiar with Access 2000 but reviewing the forums I attempted to use instr with left and right functions to extract. Didn''t work too well for me.
I think the brackets were the problem....
As long as the data to be parsed remains within brackets ([ ]), and a single space exists between the data elements and at the end of the 3rd element, then it becomes a fairly simple matter. Assuming the 2nd Column is in a Field named [Field_Test], which is in a Table named tblTest, then it becomes a Query with three Calculated Fields calling 3 simple Functions:
这篇关于如何解析具有多个字段的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!