I’ve got a question that may be easy or difficult to answer – no idea!
I work on multiple projects daily and they each require a different set of text information. For instance, I need to be able to quickly paste a First Name, a Last Name, a Date, etc. I’m using a Stream Deck for hotkey activation so that part of it is pretty easy.
What I need assistance with is this: I have software that creates a .csv file with the First Name, Last Name, Date, etc fields. From there, I’d like to use AHK to pull the variables from this file so I can paste them at my leisure. The problem being, this is in the name of efficiency so I don’t want to spend 5 minutes setting it up each time, as it defeats the purpose of time savings. I work on a new file about every ½ hour.
I guess, in my little brain, I envision the following:
Copy the .csv to a folder.
Use a hotkey which pulls the specific info from the .csv and pastes it into the webform.
When working on the next project, I just replace the .csv file in that folder and the hotkey references update.
Is this something that’s done easily or is it quite difficult? Thanks for taking the time to help with this!
Pull text from .csv
Re: Pull text from .csv
You will probably have further questions, but this should be something to start:P.s.: You made it quite difficult to help you due to lacking samples on which you are working.
Code: Select all
CsvData= ; asigning variable for demonstration
(
First Name,Sandym
Last Name,Textpuller
)
;~ FileRead, CsvData, Data.csv ; loading csv from a file
Loop, parse, CsvData, `n, `r
{
if InStr(A_LoopField, "First Name")
FirstName:=StrSplit(A_LoopField, ",")
if InStr(A_LoopField, "Last Name")
LastName:=StrSplit(A_LoopField, ",")
}
MsgBox, % "First Name: " FirstName.2 "`n" "Last Name: " LastName.2