Feature Request Tracker
|Status:||Closed (Not Implemented)|
|Submitted by:||André Hilbig|
|Summary:||DTLiflastrow for conditions in foreach|
ReportDear Nicola Talbot,
your datatool-package is very great and helps me in a lot of cases (even with big amounts of data). Sometimes I am iterating through a database with the DTLforeach-command and a condition. The condition leaves some rows out, maybe the last.
Is it possible to have a command within foreach, that can decide wether it will be the last row in the loop and not in the database itself? It seems a little bit complicated, because the DTLforeach seems to read the next row of the database every loop iteration and decides then, if the condition matches. Maybe it is possible to store the output of every iteration with a match of the condition in a savebox (e.g. the box in tcolorbox) and print the savebox when datatool knows, what row will be the last one?
Unfortunately I don't think this is possible in general as it would need to look ahead and scan the rest of the database at the end of each iteration to determine if the current row is the last to satisfy the condition, which would be very inefficient. It would be quicker to simply have two loops: the first to determine the final row index and the second to test the current row index against the previously found final row index. It would be even better if the first loop saved a list of the required row indexes and then the second loop iterated over that list (instead of the entire database). An even faster approach would be to use datatooltk to perform the filtering.
Watch This Report
If you supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.
If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.
The "Confirm Topic ID" field helps to protect against spambots. Please enter the feature request ID (which you can find at the top of this page).
To unsubscribe from all notifications use the notifications page.
You can append a comment to this report using the form below. Comments are checked first before being added. Any spam or offensive content will be removed first according to this site's Terms of Website Use. Please bear in mind that I develop and maintain free software in my spare time. If you want commerical level support then you can hire a TeX consultant.
The "Confirm Feature Request ID" field helps to protect against spambots. Please enter the feature request ID (which you can find at the top of this page).