1234567890
0987654321
The web form has three textfields into which you want to enter
a) the first four digits
b) the next three
c) the remaining three.
If you are not using the scripting interface (which would be the most easy solution), but need to make use of iMacros CSV reading abilities (via. {{!COL1}} to {{!COL3}}), a new CSV is needed that manipulates the numbers to look like this:
1234,567,890
0987,654,321
Here's the script that does this manipulation (which you may find a useful basis for your own CSV file manipulations):
Code: Select all
' Global Variables
Const INPUT_CSV="c:\input.csv" 'input file path
Const OUTPUT_CSV="c:\output.csv" 'input file path
' File access constants
Const FOR_READING = 1
Const FOR_WRITING = 2
Const FOR_APPENDING = 8
'Open input for reading
Dim objFileSystemInput, inputFile
Set objFileSystemInput = CreateObject("Scripting.fileSystemObject")
Set inputFile = objFileSystemInput.OpenTextFile(INPUT_CSV, FOR_READING, true)
'Open outout for appending
Dim objFileSystemResult, outputFile
Set objFileSystemResult = CreateObject("Scripting.fileSystemObject")
Set outputFile = objFileSystemResult.OpenTextFile(OUTPUT_CSV, FOR_APPENDING, true)
Dim nextLine, part, tempPart
Do while not inputFile.AtEndOfStream
nextLine = inputFile.ReadLine()
'now here's the splitting
tempPart = Left(nextLine,7) 'first 7 characters
part = Left(tempPart,4) 'first 4 characters
outputFile.write(part+",")
part = Right(tempPart,3) 'characters 5,6,7
outputFile.write(part+",")
part = Right(nextLine,3) 'characters 8,9,10
outputFile.write(part+vbNewLine)
loop
inputFile.Close;
set inputFile = nothing;
outputFile.Close;
set outputFile = nothing;
set objFileSystemInput = nothing
set ohjFileSystemResult = nothing
msgbox "Done."