Skip to content

Commit c81446c

Browse files
authored
Read a Text field in delimited files was not working, when the previouse field is Date and do not have delimiter (#839)
Issue: 107370
1 parent b614c63 commit c81446c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

common/src/main/java/com/genexus/util/DelimitedFilesSafe.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ public byte dfrgdate(java.util.Date[] date, String fmt, String sep)
498498
String retstr;
499499
Date retdate = CommonUtil.nullDate();
500500
int year = 0, month = 0, day = 0;
501+
boolean getnexttoken = true;
501502

502503
if (dfropen_in_use)
503504
{
@@ -506,6 +507,8 @@ public byte dfrgdate(java.util.Date[] date, String fmt, String sep)
506507
String stringDelimitedField = actline.nextToken(fdel);
507508
if(fdel.equals(stringDelimitedField) || stringDelimitedField.equals(""))
508509
{ // Si el token debe estar vac�o...
510+
if (fdel.equals(stringDelimitedField))
511+
getnexttoken = false;
509512
stringDelimitedField = "";
510513
}
511514

@@ -563,7 +566,8 @@ else if (month < 1 || month > 12 || day < 1 || day > 31)
563566
date[0] = retdate;
564567
try
565568
{
566-
String stringDelimitedField = actline.nextToken(fdel);
569+
if (getnexttoken)
570+
actline.nextToken(fdel);
567571
}
568572
catch(Exception e)
569573
{//Se sabe que se puede leer un token que no existe al final de la linea

0 commit comments

Comments
 (0)