我的 FileMaker Pro 数据库中有一个字段,其中包含以分号分隔的数据,所以我想要做的是将该数据分离到一个新表中。如果有人能指出我正确的方向,那会很有帮助
问问题
3957 次
1 回答
3
一种方法是编写一个脚本,将文本分成几行(使用GetValue()
),然后用分号(Substitute( $line, ";", "¶" )
,然后GetValue()
从结果列表中分割每一行),最后将数据发布到另一个表中(转到布局,新记录,设置字段)。如果需要,可以草绘整个脚本。
我会这样写:
Go to Layout( My Table )
Go to Record/Request/Page[ First ]
# Loop over records
Loop
Set Variable[ $line, 1 ]
# Loop over lines
Loop
Exit Loop If[ ValueCount( My Table::My Field ) < $line ]
#
# Get line values
Set Variable[ $fields,
Substitute( GetValue( My Table::My Field, $line ), ";", "¶" ) ]
# ...
Go to Layout( My Target Table )
New Record/Request
Set Field[ My Target Table::Foo, GetValue( $fields, 1 ) ]
Set Field[ My Target Table::Foo, GetValue( $fields, 2 ) ]
Go to Layout( My Table )
#
Set Variable[ $line, $line + 1 ]
End Loop
Go to Record/Request/Page[ Next, Exit After Last ]
End Loop
Go to Layout( original layout )
于 2010-11-02T13:29:43.653 回答