emmanuel 0 Posted August 18, 2004 I'd like to split a string from an INI file:[Global] List="c:\test.mdb","c:\test2.mdb" into a script to run the /Compact command on a list of mdb's that can be changed by the users. here's what I have so far:$sMdbIni = IniRead("CompactMDB.ini", "Global", "List", "c:\test.mdb") $sMdbList = StringSplit($sMdbIni, ",") For $i = 1 to $sMdbList[0] MsgBox(4096,'debug:' , '$sMdbList:' & $sMdbList[$i]);### Debug MSGBOX compactMDB ($sMdbList[$i]) Next func CompactMDB ($sMdb) $ACCESSPATH = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\msaccess.exe", "") $iMdbRun = RunWait('"' & $AccessPath & '" /compact "' & $sMdb & '"') MsgBox(4096,'debug:' , '$iMdbRun:' & $iMdbRun);### Debug MSGBOX EndFunc The problem is that either the INI read or StringSplit are doing odd things with the quotes around the filenames, the debug shows: --------------------------- debug: --------------------------- $sMdbList:c:\test.mdb" --------------------------- OK ---------------------------Shouldn't it show "c:\test.mdb" ? "I'm not even supposed to be here today!" -Dante (Hicks) Share this post Link to post Share on other sites
emmanuel 0 Posted August 18, 2004 Nevermind, I just took the quotes out of the ini file and it works, even with spaces. And I don't think commas are legal in filenames, so hopefully we don't run into that. "I'm not even supposed to be here today!" -Dante (Hicks) Share this post Link to post Share on other sites
Valik 478 Posted August 18, 2004 Actually, commas are legal in file names. The way around the issue, though, is this: [Global] List=""c:\test.mdb","c:\test2.mdb"" You might consider using | for your delimiter as it is an invalid character in a file name. Then you don't have to use quotes at all. Share this post Link to post Share on other sites
emmanuel 0 Posted August 18, 2004 Actually, commas are legal in file names. The way around the issue, though, is this: [Global] List=""c:\test.mdb","c:\test2.mdb"" You might consider using | for your delimiter as it is an invalid character in a file name. Then you don't have to use quotes at all. <{POST_SNAPBACK}>excellent, changed it to | Thanks Valik "I'm not even supposed to be here today!" -Dante (Hicks) Share this post Link to post Share on other sites