2 Replies Latest reply: Sep 4, 2012 10:22 AM by Ivan Troisi RSS

    csv extract

      Hi!

      I need to extract fields in a file(csv).

       

      The csv fields:

      @1

      # 20120717-20120717
      2,30.862,45.832,63.207
      ,30.862,45.832,63.207

       

      When "20120717" is Date, "20120717" is DateA,"2" is Day, "30.862" is View and "63.207" is ViewT

       

      I try

       


      VISISTANTES:


      LOAD @1
      FROM
      [C:\Users\u123123\Desktop\Web.csv]
      (txt, utf8, no labels, delimiter is ';', msq);

       

       

      Calculo:
      NoConcatenate
      LOAD
      IF (IsNum (Right (@1,3)) and
      IsNum (Right (@1,4)) and
      IsNum (Right (@1,5)) and
      IsNum (Right (@1,6)) and
      IsNum (Right (@1,7)) and
      IsNum (Right (@1,8)) and
      IsNum (Right (@1,9)) ,mid(@1,3,8) ) as Date

      ,

      IF (IsNum (Right (@1,3)) and
      IsNum (Right (@1,4)) and
      IsNum (Right (@1,5)) and
      IsNum (Right (@1,6)) and
      IsNum (Right (@1,7)) and
      IsNum (Right (@1,8)) and
      IsNum (Right (@1,9)) ,mid(@1,12,17) )as DateA,

       

      IF( IsNum(Left(@1,1)), Left(@1,1)) as Day,

       

      IF(IsNum(mid(@1,2,1)),mid (@1,2,6)) AS View,
      IF(IsNum(mid(@1,2,1)),mid (@1,9,6)) AS ViewA, 
      IF(IsNum(mid(@1,2,1)),mid (@1,16,6)) AS ViewT
      Resident VISISTANTES
      ;


      DROP Table VISISTANTES;

       

       

      This is good extract but this has a default, the qvd generate is complete in null.

       

      DayDateDateAViewViewA ViewT
      2
      2012071720120717
      63.20745.83230.862

       

       

      I need all in a file.

       

      DayDateDateAViewViewA ViewT
      2 20120717 20120717 63.207 45.832 30.862

       

       

      What is the problem?

       

      Regards!.

       

      Ivan Troisi