我沒有主意了。我需要格式化此文本,為“組”一詞的每個實體創建一個段落。
注意 Group1、Group2:
('uniqueName', 'Group', True ),
('Value', 'float', 0, 5, 1 ),
('Value', 'int', 1 ),
('Value', 'bool', true),
('uniqueName', 'Group', True ),
('Value', 'bool', true),
....
我需要將其分為兩段:
('uniqueName', 'Group', True ),
('Value', 'float', 0, 5, 1 ),
('Value', 'int', 1 ),
('Value', 'bool', true),
('uniqueName', 'Group', True ),
('Value', 'bool', true),
每個組代表它下面的引數,所以 Group1 有 value1 - value3。群體和價值觀共享相同的模式,因此很難。我將 QT 與 QString 一起使用。
uj5u.com熱心網友回復:
感謝 Aconcagua 的評論,我找到了解決方案。只需檢查每個組匹配并在將行復制到檔案之前添加一個新行。然后檢查不是組的所有內容,并在添加組后將其添加到檔案中:
If(Group)
{ // add a blank line
// Copy the group to the file
}
if(!Group)
{
// Copy the line to the file
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/463649.html
