Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to load multiple types of text records in one flat file

I would like to load a flat file with fixed positions to different tables, the simple structure looks like

aaa1 data1 data2 data3

bbb1 xxyy  adkdfdk

ccc1 sdkfjeekwekjrejklejreje

aaa2 data4 data4 data4

bbb2 yyxx skddldd

ccc2 data5 data5 data5

records starting with aaa should be stored in table aaa

records starting with bbb should be stored in table bbb

etc,

every table has other type of info with different fields on different fixes positions

hope this examples give an idea what kind of data I would like to load,

thanks for your suggestions.

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Something like the following will work

Table_aaa:

LOAD

  @1:5 as Field1,

  @6:10 as Field2

FROM [File] (fix, codepage is 1252)

  Where @1:3='aaa';

Table_bbb:

LOAD

  @1:5 as Field3,

  @6:10 as Field4

FROM [File] (fix, codepage is 1252)

  Where @1:3='bbb';

HIC

View solution in original post

2 Replies
hic
Former Employee
Former Employee

Something like the following will work

Table_aaa:

LOAD

  @1:5 as Field1,

  @6:10 as Field2

FROM [File] (fix, codepage is 1252)

  Where @1:3='aaa';

Table_bbb:

LOAD

  @1:5 as Field3,

  @6:10 as Field4

FROM [File] (fix, codepage is 1252)

  Where @1:3='bbb';

HIC

Not applicable
Author

Tx Henric had no experience with this type of input but your answer made it easy!

mark