Skip to content

Instantly share code, notes, and snippets.

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)
F1::
ColToRemove = 4
File = C:\Users\vmok9ne\Desktop\cmdutils\Xeroxmeterreads.csv
Output =
Loop, Parse, %File%, `n, `r
{
Loop, Parse, A_LoopField, CSV
If (A_Index <> ColToRemove)
@dimm0k
dimm0k / gist:6178526
Created August 7, 2013 20:51
[16:46] <+AfterLemon> dimmATwerk: `dR` wrote a regex version of mine, and i cut it down from 10 lines to 2 :]
amTest:="1,12a,100,1:00,01:00,01:00am,14a,01:78"
pmTest:="13,12p,100p,0100p,1:00pm,01:00 p,01:00pm,1300,1300pm,27:00,12:78"
out := ""
loop, parse, amTest, `,
out .= A_LoopField " == " ctime(A_loopfield) "`n"
msgbox % out
out := ""
loop, parse, pmTest, `,
@dimm0k
dimm0k / gist:6169936
Created August 6, 2013 23:46
AcidStrike's convert time to HH:mm
/*
Accepts most forms of Input as Time.
1, 1a, 1am, 100, 0100, 1:00, 1:00a, 1:00am, 01:00, 01:00am = 01:00
13, 1p, 1pm, 100p, 100pm, 0100p, 1:00p, 1:00pm, 01:00p, 01:00pm = 13:00
All forms of 12:00am = 00:00
*/
#Persistent
@dimm0k
dimm0k / ConvertToSecs.ahk
Last active December 20, 2015 17:39
convert time to secs with help from DateParse
;take in number of minutes and outputs seconds.
;with help via DateParse also takes in time with formats of 13:00, 1:00 pm, 1:00pm, 1:00 p, 1:00p, 13:00, 100p, 100 p, 1p, 1 p, 1pm, 1 pm
ConvertToSecs(time)
{
if time is integer
diff := time * 60
else if (InStr(time, "a")!=0 || InStr(time, "p")!=0 || InStr(time, "A")!=0 ||
InStr(time, "P")!=0 || InStr(time, ":")!=0)
{
StringRight, fixampm, time, 1
;Linear Spoon - http://www.autohotkey.com/board/topic/96036-setting-always-on-top-via-left-mouse-button-hold/?p=604824
;emulate Preme's always_on_top toggle. code began with AcidStrike@freenode#ahk, then modified by Linear Spoon
MoveThreshold = 30 ;# pixels the mouse can move and still toggle
TimeRequired = 1 ;# seconds required to toggle (can have a decimal part such as 1.5)
CoordMode, Mouse
return
~LButton::
MouseGetPos, OutX, OutY, OutWin
KeyWait, LButton, U T%TimeRequired%
Wait(obj,int="") {
While !(Instr(rs,4)&&(rs~="4{" int "}\b"))
rs.=obj.ReadyState
}
CoordMode, ToolTip, Screen
reStart:
InputBox, scriptName, Name of New Script, % "Current AHK version is: AHK"
. ( InStr( A_AhkVersion, "1.0." ) ? "Basic " : InStr( A_AhkVersion, "1.1." )
? "_L " : "Unknown " ) A_AhkVersion,,, 130
If ( ErrorLevel )
ExitApp
Else If ( !scriptName ) {
MsgBox, You Didn't Enter A Name!
GoSub, reStart