Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello together,
i have a textfile i have to work with.
But there are "bad" parts which interrupt my process. (see green marks in the example).
The "bad parts have an defined begin and a defined end.
Begin:<TableField type="Table
End: </TableField>
With textbetween() can i read this parts, but how can i delet this "bad" parts?
How often this parts appear in a text is flexible.
Thanks for your help!
Hi, you can try a script like this one:
Data0:
LOAD Filecontent as Data
From...;
LET vIter = 1;
Do
LET vIterPre = $(vIter)-1;
Data$(vIter):
Noconcatenate LOAD
Mid(Data,1,Index(Data,'<TableField type="Table')-1)
& Mid(Data,Index(Data,'</TableField>')+Len('</TableField>'))
as Data Resident Data$(vIterPre);
Drop table Data$(vIterPre);
LET vData= Peek('Data',0,'Data$(Iter)');
LET vIter=$(vIter)+1;
Loop While Index('$(vData)','<TableField type="Table');
Hi, you can try a script like this one:
Data0:
LOAD Filecontent as Data
From...;
LET vIter = 1;
Do
LET vIterPre = $(vIter)-1;
Data$(vIter):
Noconcatenate LOAD
Mid(Data,1,Index(Data,'<TableField type="Table')-1)
& Mid(Data,Index(Data,'</TableField>')+Len('</TableField>'))
as Data Resident Data$(vIterPre);
Drop table Data$(vIterPre);
LET vData= Peek('Data',0,'Data$(Iter)');
LET vIter=$(vIter)+1;
Loop While Index('$(vData)','<TableField type="Table');
Did you try to load the file as xml ?
- Marcus
Thanks a lot. A perfect solution!
Frank