BrettF Posted February 18, 2007 Share Posted February 18, 2007 Say i have the following text (the file is one line with other enterys...) in a file: SerialNumber: xxxxxxxxxxx The serial number is for my ipod... how can i get the xxxxxxxxxxx? Im not sure how? Thanxs Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
hearurscream Posted February 18, 2007 Share Posted February 18, 2007 Search the Help File for FileOpen() and FileReadLine(). Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2007 Author Share Posted February 18, 2007 Search the Help File for FileOpen() and FileReadLine().and then what? I really shouldnt have been up all night... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2007 Author Share Posted February 18, 2007 and then what? I really shouldnt have been up all night...I think ive got it now... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
hearurscream Posted February 18, 2007 Share Posted February 18, 2007 FileOpen ( "filename", mode )Parametersfilename Filename of the text file to open. mode Mode (read or write) to open the file in.Can be a combination of the following: 0 = Read mode 1 = Write mode (append to end of file) 2 = Write mode (erase previous contents) 4 = Read raw mode 8 = Create directory structure if it doesn't exist (See Remarks).Both write modes will create the file if it does not already exist. The folder path must already exist (except using mode '8' - See Remarks). And then use FileReadLine() to read whichever line of the document the serial is. Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2007 Author Share Posted February 18, 2007 Its all on one line... Thanxs.. I thing ive got it now... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2007 Author Share Posted February 18, 2007 (edited) Or not... _StringBetween didnt work... The Code I Tried: Func _GetIpods ($listview) $DriveGet = DriveGetDrive("REMOVABLE") For $i = 1 to $DriveGet[0] If FileExists ($DriveGet[$i] & "\iPod_Control\Device\SysInfo") Then ;SysInfo is just a file with no extention... Msgbox(0,"","It is infact the ipod drive") $file = FileOpen ($DriveGet[$i] & "\iPod_Control\Device\SysInfo", 0) If $file = -1 Then Msgbox(0,"","Error Opening File") EndIf $line = FileRead ($File, 1) $Serial = _StringBetween ($line, "SerialNumber:", "ModelNumStr:") IF $Serial = 1 or $serial = 0 Then Msgbox(0,"","Error Getting Serial") Else MsgBox (9, "", "The Serial Number is:" & $Serial) EndIf EndIf Next EndFunc Edit: Missed a bit... Edited February 18, 2007 by bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
hearurscream Posted February 18, 2007 Share Posted February 18, 2007 Umm.. well you put the msgbox() command after the Else statement. Put it outside the 2nd EndIf.. that should fix your problem, unless there is a different problem with StringBetween() Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2007 Author Share Posted February 18, 2007 It seems there was an error in how it was reading the text... Thanks for your help. I can fix it from here. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
hearurscream Posted February 18, 2007 Share Posted February 18, 2007 And also, you have to #include <String.au3> Infinity is a floorless room without walls or ceiling.Anyone who cannot cope with mathematics is not fully human. At best he is a tolerable subhuman who has learned to wear shoes, bathe, and not make messes in the house. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted February 18, 2007 Share Posted February 18, 2007 and or you can try stringregexp Link to comment Share on other sites More sharing options...
BrettF Posted February 18, 2007 Author Share Posted February 18, 2007 and or you can try stringregexpThanks all.... Its fixed now... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! 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