Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/22/2012 in all areas

  1. Mechaflash

    ControlMove Help

    It's like telling someone to move an object without telling them what to move... Boss: Hey you... go move that thing over there. You: What thing? Boss: That thing. You: Can you at least point to it? Boss: No... just move it. You: Move what? You're not telling me what you want moved. Boss: You're fired.
    1 point
  2. Other examples, with and without colons:- If FileExists("in.txt") = 0 Then FileWrite("in.txt", _ "ejkhfjkhf:jkhdkjhdkjhdedi77d38g239dg9g9" & @CRLF & _ "jefdhwejkhfwef8h:wejifhwejhwef" & @CRLF & _ "wehdfwejh:ewfg287gf8723gf" & @CRLF & _ "323rRfef3:f39f78g39fg93f:Lfui23hf2L23fu2hfui2f:32fih" & @CRLF & _ "234df1ds:du19hd912398dh8dh") ConsoleWrite("------ jchd without colon.-------" & @LF) ;FileWrite("out.txt", StringRegExpReplace(FileRead("in.txt"), "(?m)^([^:]*?)(:.*)$", "$1")) ; jchd without colon. ConsoleWrite(StringRegExpReplace(FileRead("in.txt"), "(?m)^([^:]*?)(:.*)$", "$1") & @LF) ; jchd without colon. ConsoleWrite("------ Results with colon.-------" & @LF) ConsoleWrite(StringRegExpReplace(FileRead("in.txt"), "([^:]*?:).*", "$1") & @LF) ; Results with colon. ConsoleWrite("------ Results without colon.-----" & @LF) ConsoleWrite(StringRegExpReplace(FileRead("in.txt"), "(:.*)", "") & @LF) ; Without colon, results same as jchd's. FileDelete("in.txt") #cs ------ jchd without colon.------- ejkhfjkhf jefdhwejkhfwef8h wehdfwejh 323rRfef3 234df1ds ------ Results with colon.------- ejkhfjkhf: jefdhwejkhfwef8h: wehdfwejh: 323rRfef3: 234df1ds: ------ Results without colon.----- ejkhfjkhf jefdhwejkhfwef8h wehdfwejh 323rRfef3 234df1ds #ce
    1 point
  3. Try this one-liner: FileWrite("out.txt", StringRegExpReplace(FileRead("in.txt"), "(?m)^([^:]*?)(:.*)$", "$1"))
    1 point
  4. antisocialneedinghelp, - Read the file into an array with _FileReadToArray. - Loop through the file using StringInStr to get the position of the first ":". - Use StringMid or StringLeft to get the charracters to the left of that point and reassign them to the array element. - Finally use _FileWriteToArray to rewrite the file. M23
    1 point
×
×
  • Create New...