Romano71 Posted January 8, 2021 Posted January 8, 2021 Thank you for this great program! I am sure this questiion as been asked several times bu a cannot find it: Func Example1() Local $sFileRead = FileRead($sFileName) Local $aFileRead = _StringBetween($sFileRead, "BOOK: ", " ") If Not @error Then _ArrayDisplay($aFileRead, "_StringBetween") Else ConsoleWrite('! _StringBetween : No matches found' & @CRLF) EndIf EndFunc How does one read all the line, as per example the book name is "hello world", it only reads "hello", i mean i want it to read the full line.
Nine Posted January 8, 2021 Posted January 8, 2021 Show an example of the file content you are reading. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
Romano71 Posted January 8, 2021 Author Posted January 8, 2021 ALBUM : Error Code ARTIST : R.K. Howard READ BY : Julie McKay, Punch Audio
Nine Posted January 8, 2021 Posted January 8, 2021 And you want to get what ? “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
Romano71 Posted January 8, 2021 Author Posted January 8, 2021 sorry in fist post i say Book, but i mean Album
Nine Posted January 8, 2021 Posted January 8, 2021 #include <Array.au3> $sString = _ "ALBUM : Error Code" & @CRLF & _ "ARTIST : R.K. Howard" & @CRLF & _ "READ BY : Julie McKay, Punch Audio" & @CRLF & _ "ALBUM : Second Code" & @CRLF & _ "ARTIST : Maxime Chattam" & @CRLF & _ "READ BY : Nobody, Punch Audio" $aAlbum = StringRegExp($sString, "ALBUM : (.*)", 3) _ArrayDisplay($aAlbum) Try this Romano71 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy
iamtheky Posted January 8, 2021 Posted January 8, 2021 Your line looks for everything between "BOOK<colon><space>" and the next <space>" Your example does not contain the string BOOK, but if it followed that pattern would be "BOOK<space><colon><space>" You probably just want everything between your target and the carriage return Local $aFileRead = _StringBetween($sFileRead, "BOOK: ", @CRLF) Romano71 1 ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__)
Romano71 Posted January 8, 2021 Author Posted January 8, 2021 Thank you solved. Is there a way to edit posts?
FrancescoDiMuro Posted January 8, 2021 Posted January 8, 2021 @Romano71 Since you have very few post, you need to reach some more to have the ability to edit them Romano71 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
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