Skip to content

Instantly share code, notes, and snippets.

@dimm0k
Last active Dec 20, 2015
Embed
What would you like to do?
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