2 Replies Latest reply: May 15, 2012 1:03 PM by Vladimir Komarov RSS

    Howto load text file with fixed and variable part

    Peter Hübschen

      Hello,

       

      I'm getting the same error message as in "Too complex, more than 100 levels nesting", but my problem is, I don't have any idea how to make a better solution. So does anyone have a - maybe simplier - solution for the following problem:

      I have to read a txt-file (separated by ";") with a fixed part and a variable part. The number of columns is defined by a value in the fixed part. I have to get a table where for every value is in a separated line with a changed Timestamp.

      At the moment I make it with variables and nested-ifs where IterNo() is the condition and the timestamp-calculation is based on IterNo() too.

       

      Example txt-File:

      Counter; Timestamp      ; NoOfValues; V1; V1Flag; V2; V2Flag;...... Vn; VnFlag;

      4711   ; 01.01.12 01:00 ; 24        ; 10; W     ; 20; W     ;......

      4712   ; 01.01.12 00:15 ; 96        ; 15; W     ; 10; F     ;........

       

      Result:

      Counter; Timestamp      ; Value; ValueFlag;

      4711   ; 01.01.12 01:00 ; 10   ; W        ;

      4711   ; 01.01.12 02:00 ; 20   ; W        ;

      ...

      4711   ; 02.01.12 00:00 ; 30   ; W        ;

      4712   ; 01.01.12 00:15 ; 15   ; W        ;

      4712   ; 01.01.12 00:30 ; 10   ; F        ;

      ...

      4712   ; 02.01.12 00:00 ; 20   ; W        ;

       

      Thanks in advance for any help.

       

      Peter