kimurtus Posted October 31, 2007 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
rasim Posted October 31, 2007 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
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