wutzke Posted November 26, 2006 Share Posted November 26, 2006 We have multi-page report with data to crunchEach page is headed by16-Oct, 06 16:04 Page 1/1252(with each page show as ##/##)The regexp I wrote is:(0[1-9]|[12][0-9]|3[01])[- /.](\b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\b)(\b(?:, )\b)([0-9]{2}[- /.])([0-9]{2}[: /.])([0-9]{2}[- /.])(\b(?:Page )\b)What would you see as the best way to code that into a loop with $page holding the entire page text?$headcheck = StringRegExp($page, $regexp, 3) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 26, 2006 Moderators Share Posted November 26, 2006 (edited) This pattern seemed to work:$sString = "16-Oct, 06 16:04 Page 1/1252" $sPattern = "(?s)(?i)\d{2}\-\w{3},\s+\d{2}\s+\d{2}\:\d{2}\s+Page\s+(\d+/\d+)" $aArray = StringRegExp($sString, $sPattern, 3) MsgBox(64, 'Info:', $aArray[0])oÝ÷ Ù«¢+ØÀÌØíÁô¥±I ÌäíÑáйÑáÐÌäì¤? If it's all together after that, then you may look at breaking the pages up using the returned results from the above StringRegExp... Do /Count += 1/Until Line = $aArray[$num] or something. Edit: After running your SRE example, I may have been confused on what it was you were trying to return, see if this is more like it:#include <array.au3> $sString = "16-Oct, 06 16:04 Page 1/1252" $sPattern = "(?s)(?i)(\d{2})\-(\w{3}),\s+(\d{2})\s+(\d{2})\:(\d{2})\s+(Page)\s+(\d+/\d+)" $aArray = StringRegExp($sString, $sPattern, 3) _ArrayDisplay($aArray, '') Edit2: Blah... Autoit code tags had a smiley face in the SRE pattern. Edited November 26, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
wutzke Posted November 27, 2006 Author Share Posted November 27, 2006 I got your drift ...thanks this project was part of what I'm working on from this postCSV Reader, Reformat a Comma Separated File to Excel Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now