kimurtus Posted October 31, 2007 Share Posted October 31, 2007 (edited) this is the line in a textfile <ado$, arriba, cordoba, A$, A 8$, DATOS, co da no, kJe, ABC$, Ma do, Mitos, Prev_D_Trib_7.1, punto> I need to write it into ini file reading the line until a "," is found, thene break the line and delete the space after the coma, and then read again, if there is a text with a $ in it it must be ignored result must be arriba cordoba DATOS co da no kJe Ma do Mitos Prev_D_Trib_7.1 punto text not wanted in file ABC$ A$ A 8$ ado$ Edited October 31, 2007 by kimurtus Link to comment Share on other sites More sharing options...
rasim Posted October 31, 2007 Share Posted October 31, 2007 Example: $iniFile = "c:\your.ini" $read = FileRead("c:\test.txt", FileGetSize("c:\test.txt")) $splitStr = StringSplit($read, @LF) For $i = 1 To $splitStr[0] If Not $splitStr[$i] = '' Then Parsing($splitStr[$i]) Next Func Parsing($rString) Local $sSplit = StringSplit($read, "," & @CR & @LF) For $i = 1 To $sSplit[0] If Not $sSplit[$i] = '' And Not StringInStr($sSplit[$i], "$") Then IniWrite($iniFile, "YourSection", $sSplit[$i], "1") Next EndFunc Link to comment Share on other sites More sharing options...
kimurtus Posted October 31, 2007 Author Share Posted October 31, 2007 thanks alot rasim 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