• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Automate form fill CSV file to fill a form

Hi, I have CSV text copied to a file my_csv_values.txt from excel, I need to fill a form in Firefox or IE.

You move from on text field to another by TAB key.

How can automate this?

Form is very simple (vertical field layout) and my CSV file is like:

2,4,12,14,12,5,6,78

I need to fill 36 values.
 
Make up a blank excel/calc work sheet and export as a csv, then open in notepad.

edit: Wait a minute, I misunderstood. You are in the web browser. Try roboform to automate it.
 
This sounds like a job for VBScript!

Here's a script that, when activated, will read the first line from a file called "csvfile.txt", split it by commas, and type the values separated by tabs. To use it, save it as a file (e.g. "tabscript.vbs"), create a shortcut to it in the same place (e.g. on the desktop), add a shortcut key for that shortcut (in the shortcut properties, type, e.g. Ctrl-Alt-T in that field), and create a file "csvfile.txt" in the same place with those comma-separated values on one line. Then go to your browser, select the first field, hit that shortcut key combination (Ctrl-Alt-T), and away it should go!

Option Explicit
Dim objShell, oFSO, objFile, fileLine, i
Const strFile = "csvfile.txt"

Set objShell = WScript.CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = oFSO.OpenTextFile(strFile, 1)
fileLine = objFile.ReadLine
objFile.Close
fileLine = split(fileLine, ",")

for each i in fileLine
objShell.SendKeys i
objShell.SendKeys "{TAB}"
next

By the way, I wanted to read the CSV data from the clipboard, but apparently VBScript can't do that (easily).
 
For some unknown reason I can't get it to work 🙁
I designed the page myself that I need to get values into using dreamweaver. Is it possible to add a button "browse" to load file with CSV values and place them into fields that I have names in my php file?
 
Well, if the page is that simple, you can probably go around the web browser entirely. If you can use GET, just make up a list of URLs with the proper values (you can do this in Excel with formulas) and then run them through WGet or cURL. POST would be a little more difficult, but you could probably make a column of cURL statements and run it as a batch file.
 
Originally posted by: Ken g6
This sounds like a job for VBScript!

Here's a script that, when activated, will read the first line from a file called "csvfile.txt", split it by commas, and type the values separated by tabs. To use it, save it as a file (e.g. "tabscript.vbs"), create a shortcut to it in the same place (e.g. on the desktop), add a shortcut key for that shortcut (in the shortcut properties, type, e.g. Ctrl-Alt-T in that field), and create a file "csvfile.txt" in the same place with those comma-separated values on one line. Then go to your browser, select the first field, hit that shortcut key combination (Ctrl-Alt-T), and away it should go!

Option Explicit
Dim objShell, oFSO, objFile, fileLine, i
Const strFile = "csvfile.txt"

Set objShell = WScript.CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = oFSO.OpenTextFile(strFile, 1)
fileLine = objFile.ReadLine
objFile.Close
fileLine = split(fileLine, ",")

for each i in fileLine
objShell.SendKeys i
objShell.SendKeys "{TAB}"
next

By the way, I wanted to read the CSV data from the clipboard, but apparently VBScript can't do that (easily).

Tried your sollution on another PC and it works perfect. If only I could control how the tab cursor moves that would be awesome, now I have to structure my csv file exactly how my form is made. I have to skip a few text fields not sure how will I solve this, I could hide them they contain static information that needs to be entered by the form.
 
Back
Top