Search found 470 matches

by AlphaBravo
24 Jan 2020, 17:26
Forum: Ask For Help
Topic: Constantly display the last five lines of an Excel or CSV file
Replies: 4
Views: 263

Re: Constantly display the last five lines of an Excel or CSV file

give this a try: Gui, +AlwaysOnTop Gui, font, S12 Consolas Gui, add, edit, w500 r6 vLast5 Gui, show SetTimer, ReadCSV, 5000 ; 5 seconds, adjust timer frequency as you wish return GuiClose: ExitApp return ReadCSV: FileRead, data, Scan Log 01-23-2020-03.csv data := Trim(data, "`r`n") line := StrSplit(...
by AlphaBravo
18 Dec 2019, 20:42
Forum: Ask For Help
Topic: Finding a pattern
Replies: 5
Views: 432

Re: Finding a pattern

blad4 wrote:
18 Dec 2019, 17:25
How do we further simplify and just extract the '208' only.
Or if the input is 142, we get 210, 145 we get 212 etc
What kind of input is it going to be (variable/user input/clipboard..)?
What if the input is not a start of a "pattern" 140, 141 etc.?
by AlphaBravo
17 Dec 2019, 17:03
Forum: Ask For Help
Topic: Finding a pattern
Replies: 5
Views: 432

Re: Finding a pattern

S1 := 1, S2 := 70, S3 := 139, S4 := 208 Loop, 23 { line := S3 "-" S3+2 " : " S4 "-" S4+1 res .= line "`n" S3 += 3 S4 += 2 } MsgBox, 262144, ,% res ; opposite direction S1 := 1, S2 := 70, S3 := 139, S4 := 208 res := "" Loop, 23 { line := S4 "-" S4+1 " : " S1 "-" S1+2 res .= line "`n" S1 += 3 S4 += 2...
by AlphaBravo
08 Aug 2019, 14:00
Forum: Ask For Help
Topic: How to remove all the lines except last one from the clipboard Topic is solved
Replies: 8
Views: 752

Re: How to remove all the lines except last one from the clipboard Topic is solved

Code: Select all

Clipboard := RegExReplace(Clipboard, "`as)^.*\R(\V+)\R*$", "$1")
MsgBox % Clipboard
by AlphaBravo
08 Aug 2019, 13:51
Forum: Ask For Help
Topic: Exclude Specific Locations in File Listing Loop Topic is solved
Replies: 6
Views: 587

Re: Exclude Specific Locations in File Listing Loop Topic is solved

give this a try: ExcludeDir := "i)\Q" Windir "\E|\Q" AppData "\E|\Q" ProgramData "\E|\Q" ProgramFiles "\E" Loop, Files, c:\*, DR { if RegExMatch(A_LoopFilePath, ExcludeDir) { MsgBox, , Skipping this folder, % A_LoopFilePath continue } Loop, Files, % A_LoopFilePath "\*.txt" MsgBox ,, % A_LoopFileDir,...
by AlphaBravo
10 Jul 2019, 19:31
Forum: Ask For Help
Topic: Running Loop for a Limited Amount of Time Topic is solved
Replies: 2
Views: 349

Re: Running Loop for a Limited Amount of Time Topic is solved

totalTime := stop - start needs to be inside the loop
by AlphaBravo
22 Mar 2019, 13:25
Forum: Ask For Help
Topic: workday
Replies: 5
Views: 896

Re: workday

MsgBox % WorkDay(20190322, 2, [20190326, 20190327]) MsgBox % WorkDay(20190322, 2) return WorkDay(Start_Date, Days, Holidays := ""){ WorkDay_Loop: while Days { Start_Date++ FormatTime, WeekDay , % Start_Date, WDay if WeekDay in 1,7 continue for each, Holiday in Holidays if (Start_Date = Holiday) con...
by AlphaBravo
20 Mar 2019, 08:58
Forum: Ask For Help
Topic: Adjust vertical mouse sensitivity?
Replies: 6
Views: 1121

Re: Adjust vertical mouse sensitivity?

this seems to work SPI_GETMOUSESPEED = 0x70 SPI_SETMOUSESPEED = 0x71 DllCall("SystemParametersInfo", UInt, SPI_GETMOUSESPEED, UInt, 0, UIntP, OrigMouseSpeed, UInt, 0) return Tab:: MouseGetPos, mx1, my1 while GetKeyState("Tab", "P") { MouseGetPos, mx2, my2 if (mx1 = mx2) && (my1 <> my2) ; vertical mo...
by AlphaBravo
19 Mar 2019, 11:00
Forum: Ask For Help
Topic: Need to sum duplicate value and price
Replies: 7
Views: 941

Re: Need to sum duplicate value and price

data = (C Invoice No Invoice Date Pt Name Address Customer ID Old Customer ID Order No Order Date Delivery No Delivery Date Our Reference Item ID Unit Unit Price Item Name HCPC Code Total Price Discount Contract Allowed Net Price (Item) Pt Share (Item) Pt Resp (Item) SubTotal Oth Resp Invoice Total...
by AlphaBravo
24 Feb 2019, 13:09
Forum: Ask For Help
Topic: AHK: Excel_Autofilter
Replies: 3
Views: 608

Re: AHK: Excel_Autofilter

I think you have to loop through visible cells

Code: Select all

for c in xl.Worksheets(1).AutoFilter.Range.Columns("E").SpecialCells(12)
{
	if A_Index = 2 				; second row after title
	{
		MsgBox % c.address " = " c.value
		break
	}
}
by AlphaBravo
19 Feb 2019, 21:00
Forum: Ask For Help
Topic: regex question Topic is solved
Replies: 6
Views: 920

Re: regex question Topic is solved

just me wrote:
19 Feb 2019, 03:49
Not quite.
RegEx - Quick Reference wrote:\w ... This is equivalent to [a-zA-Z0-9_]. ...
fair enough ;)
by AlphaBravo
18 Feb 2019, 21:41
Forum: Ask For Help
Topic: regex question Topic is solved
Replies: 6
Views: 920

Re: regex question Topic is solved

I am guessing this is what you're looking for variable = abcd-567 ; or 12abcd-567 if RegExMatch(variable,"((?:\d|\w)+)-(\d+)",vars) msgbox,% vars1 . "_" . vars2 ; or if RegExMatch(variable,"((\d|\w)+)-(\d+)",vars) msgbox,% vars1 . "_" . vars3 ; or variable = 12abcd-567 if RegExMatch(variable,"(\w+)-...
by AlphaBravo
10 Feb 2019, 12:17
Forum: Ask For Help
Topic: How to get handle to specific excel file among multiple opened excel files?
Replies: 19
Views: 2629

Re: How to get handle to specific excel file among multiple opened excel files?

try this

Code: Select all

path := "c:\a.xlsx"
WB := ComObjGet(path)
xl := WB.Application
by AlphaBravo
05 Feb 2019, 16:04
Forum: Ask For Help
Topic: How to add text to a text file (encoding!) Topic is solved
Replies: 18
Views: 2250

Re: How to add text to a text file (encoding!) Topic is solved

try the following, it didn't change encoding for me File := A_ScriptDir . "\Test.txt" ; Encoding unknown! AddStr := "Add this line." file := FileOpen(File, "rw") if !IsObject(file) { MsgBox Can't open "%File%" return } fileContents := file.Read() file.Position := 0 file.Write(AddStr "`r`n" fileConte...
by AlphaBravo
02 Feb 2019, 23:44
Forum: Ask For Help
Topic: HELP: Strings? Arrays? A-Arrays?
Replies: 5
Views: 794

Re: HELP: Strings? Arrays? A-Arrays?

this code is based on the assumption that all lines end with "ClearDX" HTN := "HTN,CBC,CMP" ;,ClearDX" HLD := "HLD,CMP,Lipid_Pane" ;,ClearDX" T2DM := "T2DM,A1c,CMP,UrineMA" ;,ClearDX" Anemia := "Anemia,CBC,Ferritin,TIBC" ;,ClearDX" Diags_Present := "HLD,T2DM," ; example present := [] for each, diag ...
by AlphaBravo
28 Jan 2019, 12:53
Forum: Ask For Help
Topic: parse a string with regex delimiter
Replies: 8
Views: 929

Re: parse a string with regex delimiter

Code: Select all

string = sd12354fg14582gh25468jj54582rr45821lk45896qq7854
MsgBox % string := Trim(RegExReplace(string , "[a-zA-Z]+\d+", "$0 "), " ")
by AlphaBravo
25 Jan 2019, 23:12
Forum: Ask For Help
Topic: Extract hostname from URL?
Replies: 14
Views: 1689

Re: Extract hostname from URL?

to catch other domains as well as ".com"

Code: Select all

myVariable =
(
Input: https://mysite.myorginzation.com:8443
Input: https://mysite.myorginzation.org/page/app.aspx
Input: ftp://mysite.myorginzation.net
)

while pos := RegExMatch(myVariable, "://\K([^/:\s]+)", m, A_Index=1?1:pos+StrLen(m))
	MsgBox % m1

Go to advanced search