Skip to content

Instantly share code, notes, and snippets.

@dimm0k
Last active December 20, 2015 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimm0k/6188802 to your computer and use it in GitHub Desktop.
Save dimm0k/6188802 to your computer and use it in GitHub Desktop.
File := CSV_remrow(File, 1)
;broken because the lack of implicit brackets!
;[16:39] <+gilby> dimmATwerk, i think your else is matching the second if in your first function
CSV_remrow(InFile, RowToRemove, FindText="")
{
Output =
if (RowToRemove != 0)
Loop, Parse, InFile, `n, `r
if (A_Index <> RowToRemove)
Output .= A_LoopField "`r`n"
else
Loop, Parse, InFile, `n, `r
if A_LoopField not contains %FindText%
Output .= A_LoopField "`r`n"
return Output
}
CSV_remrow2(InFile, RowToRemove, FindText="")
{
Output =
if !(RowToRemove = 0)
Loop, Parse, InFile, `n, `r
if (A_Index = RowToRemove)
continue
else
Output .= A_LoopField "`r`n"
else
Loop, Parse, InFile, `n, `r
if A_LoopField not contains %FindText%
Output .= A_LoopField "`r`n"
return Output
}
;AfterLemon#ahk@freenode
CSV_remrow3(InFile, RowToRemove, FindText="")
{
Output := ""
Loop, Parse, InFile, `n, `r
if (A_Index != RowToRemove)
if A_LoopField not contains %FindText%
Output .= A_LoopField "`r`n"
return Output
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment