when i try to import txt file contains “R12000025918905708201” using fixed filetype dataport. startpos includes quote. i need to ignore the starting and ending quotes. i know that i can do this using variable type dataport, but i need to use it in fixed type dataport. pls help.
You can either do this in the trigger onAfterImport or why not just specify the the field starts one character later and ends one earlier?
Thanks for your reply ERIK, Only some of the lines starts and Ends with quotes. so we cannot skip this first and last character, pls suggest me some sample code to ignore first character if it is quotes.
You can use DELCHR in the OnAfterImport trigger of those fields then.
for example the first 3 characters assigned to variable a like wise next 5 character assigned to variable b.
if we delete the first character from variable a, the start pos of variable b is still 4. it should be 5
so how can we change the startpos of dataport fields if starts with quote.
You have to import the full field and then from the OnAfterImport trigger use DELCHR to remove the leading and trailing ".
Text := DELCHR(Text, ‘<>’,’"’);
SourceExpr StartPos Width
FirstName 1 5
MiddleName 6 5
LastName 11 3
Textfile contains: ShyamKumarRao
FirstName = Shyam
MiddleNAme = Kumar
LAstNAme = Rao
but my textfile contains “ShyamKumarRao”
then how can i delimit the first and last character if quotes.
not all line contains quotes, only some of the lines contains quotes, how to delimit the quote if the first character is quote,
For the third time I’m going to suggest that you try with DELCHR!!!
Thanks Erik, We deleted dataport fields and assigned all variables through code. by this we can able to delete the first character using DELCHR,