Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading statements to achieve the desired shape

Hey guys, I have a script that works with a .txt file that is attached. Recently I change this to a .brn file (specific from another program). When I load it inside, data comes different, with no tabs or spaces...

If you change the load to spaces as delimiter, data looks the better I can get, but i need to look like the .txt file, so it works...

Can someone help me out shaping this data?

2 Replies
Anonymous
Not applicable
Author

Hi,

I have opened the .txt file and saved it as .brn file and tried to load the .brn file and found it is showing similar to that of .txt file.

Not applicable
Author

yes, they are basically the same file, but i want a direct connection to the .brn, without having to save it as a .txt file... my script is working like this:

Raw:

LOAD @1,

    @2,

    @3,

    @4

FROM

[My restaurant.txt]

(txt, codepage is 1252, no labels, delimiter is '\t', msq, header is 0 lines, filters(

Replace(1, top, StrCnd(null))

));

Menu:

LOAD

  @1,

  if(@2='',peek('Course', RowNo()-2), @2) as Course,

  if(@3='',peek('Plate', RowNo()-2), @3) as Plate,

  @4 as Food

RESIDENT Raw

WHERE @1 = 'Menu'

;

Foods:

LOAD @1,

  if(@2='',peek('Course', RowNo()-2), @2) as Course,

  if(@3='',peek('Plate', RowNo()-2), @3) as Plate,

  @4 as Food

RESIDENT Raw

WHERE @1 = 'Foods'

;

Ingredients:

LOAD @1,

  if(@2='',peek('Course', RowNo()-2), @2) as Ingredients1

// if(@3='',peek('Dish', RowNo()-2), @3) as Dish,

// @4 as Ingredient

RESIDENT Raw

WHERE @1 = 'Ingredients'

;

will it work out the same if I use the ".brn" file?