Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
niccolo24
New Contributor II

Load from textfile with delimited records

Hi,

i need to upload a text file that has a defined record size as detailed below. Is there an automatic way to set the character lenght when uploading a file?

BEGINHEADER

BOARDRLT01 DATA_COMPETENZA=D=8

BOARDRLT02 COD_FB=D=10

BOARDRLT03 TAX_BENEFIT_NEW_VOLONTARIO=N=15

BOARDRLT04 LIFE_FUND_PAC_INI=N=15

BOARDRLT05 ADEGUAMENTO=N=15

BOARDRLT06 ALTERNATIVE_PAC_INI=N=15

BOARDRLT07 LIFE_SERENITY=N=15

BOARDRLT08 PREMIUM_PLAN_PAC_INI=N=15

BOARDRLT09 CAPITAL_NEW_EP_MYP_PAC_INI=N=15

BOARDRLT10 FONDI_PAC_INI=N=15

BOARDRLT11 TOTALE_PAC_VITA_FONDI=N=15

BOARDRLT12 TAX_BENEFIT_NEW_TFR=N=15

BOARDRLT13 TAX_BENEFIT_NEW_TRASFERIMENTI=N=15

BOARDRLT14 TAX_BENEFIT_NEW_TFR_STORICI=N=15

BOARDRLT15 CNTR_TAX_BENEFIT_NEW_TFR=N=15

BOARDRLT16 LIFE_FUND_PIC=N=15

BOARDRLT17 SINERGY=N=15

ENDHEADER

5 Replies
Not applicable

Re: Load from textfile with delimited records

Hi,

Like this

Load @1:12 as Filed1,

        @13:28 as field2

   -------

----

from emp.txt;

here 1-12 fixed width is first field and 13 to 28 has second field like that you need to do the fixing between the fields while loading

niccolo24
New Contributor II

Re: Load from textfile with delimited records

I know how to do that, i was hoping there is a tool that does that in automatic with some simple inputs.

Not applicable

Re: Load from textfile with delimited records

Hi,

I don't know which tool is use for this can be do it automatically.

Re: Load from textfile with delimited records

you could try to use blanks as a delimiters instead of fixed length records.

As far as I can see, there are no blanks in the second field (the part after BOARDRLTxx).

hope this helps

regards

Marco

Re: Load from textfile with delimited records

Hi,

maybe like:

QlikCommunity_Thread_141663_Pic1.JPG.jpg

LOAD @1 as Field1,

     @2 as Field2

FROM [QlikCommunity_Thread_141663.txt] (txt, codepage is 1252, no labels, delimiter is spaces, msq, header is 1 lines)

Where @1<>'ENDHEADER';

hope this helps

regards

Marco

Community Browser