FileName = S:\Pwlis\AutoHotKey\Scripts\TEST\P-Data.csv
FileRead, File, %FileName%
loop, Parse, File, `n, `r
{
IfNotInString, A_LoopField, `,
Continue
StringSplit,Temp, A_LoopField, `,
PrintNumber = %Temp1%
Mnemonic = %Temp2%
AltMnemonic = %Temp3%
Name = %Temp4%
Abbrev = %Temp5%
Type = %Temp6%
Container = %Temp7%
RefCode = %Temp8%
ResCode = %Temp9%
Charge = %Temp10%
BillingCode = %Temp11%
CPTCode = %Temp12%
EMRID = %Temp13%
CollectInst = %Temp14%
TMem1 = %Temp15%
TMem2 = %Temp16%
TMem3 = %Temp17%
TMem4 = %Temp18%
TMem5 = %Temp19%
TMem6 = %Temp20%
TMem7 = %Temp21%
TMem8 = %Temp22%
TMem9 = %Temp23%
TMem10 = %Temp24%
TMem11 = %Temp25%
TMem12 = %Temp26%
TMem13 = %Temp27%
TMem14 = %Temp28%
Gosub, Pbuild
}
Return
The problem arises when I get to the "TMem" variables. The system requires a {TAB} if the variable is present, but doesn't if it's a blank field. There can be up to 14 entries in the system. Some entries have 2 of the 14 Tmem variables and others have the full 14. When I get to this point, I have problems:
Send %TMem1%{TAB}
Send %TMem2%{TAB}
Send %TMem3%{TAB}
Send %TMem4%{TAB}
Send %TMem5%{TAB}
Send %TMem6%{TAB}
Send %TMem7%{TAB}
Send %TMem8%{TAB}
Send %TMem9%{TAB}
Send %TMem10%{TAB}
Send %TMem11%{TAB}
Send %TMem12%{TAB}
Send %TMem13%{TAB}
Send %TMem14%{TAB}
After each variable, AHK sends a {TAB}. I realize that in the initial setup of the script, I tell the parsing to "IfNotInString, A_LoopField, `,
Continue" so it's continuing on to the next entry {TAB}. How can I construct the script in such a way to only have the {TAB} occur if there's something populating that variable in the CSV field, and not do it if it's blank?
Thank You in advance!




