« Return to the blog entry
you call this a ProTip?
why not do it really fancy...
and just use 1 step!
you can search for (.*)\n which will find all text until the end of the line
you can replace with "$1"\n (sometimes, depending on the editor $1 has to be replaced with \1
then you only need one step!
You can actually create full code with this technique! We use it to create code to import from Excel
source (can be easily created, by concatenating columns, in Excel and even maintained by a customer for easy maintenance) is something like:
columnId@@@Fieldname@@@FieldType
resulting source code is a list of Types
Type importField
columnId as string
fieldName as string
fieldType as string ' can be used for conversions if needed
end Type
dim importFields list as importField
'from here it's the auto generated code as per technique explained above
set thisImportField = new importField
thisImportField.columndId = "A"
thisImportField.fieldName = "Firstname"
thisImportField.fieldType = "String"
that way you can create an import setup script with 500 lines in 15 min
you call this a ProTip?
why not do it really fancy...
and just use 1 step!
you can search for (.*)\n which will find all text until the end of the line
you can replace with "$1"\n (sometimes, depending on the editor $1 has to be replaced with \1
then you only need one step!
You can actually create full code with this technique! We use it to create code to import from Excel
source (can be easily created, by concatenating columns, in Excel and even maintained by a customer for easy maintenance) is something like:
columnId@@@Fieldname@@@FieldType
resulting source code is a list of Types
Type importField
columnId as string
fieldName as string
fieldType as string ' can be used for conversions if needed
end Type
dim importFields list as importField
'from here it's the auto generated code as per technique explained above
set thisImportField = new importField
thisImportField.columndId = "A"
thisImportField.fieldName = "Firstname"
thisImportField.fieldType = "String"
that way you can create an import setup script with 500 lines in 15 min