Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
gayatri7
Creator II
Creator II

Fixed File conditional delete issue

Hi All,

I am loading the data from fixed text file and below is the code, which is working fine.

LOAD [@1:2] as [Codigo Banco],

     [@11:25] as [Policy Number],

     [@44:52] as [Monto de cobro],

     [@55:62] as [Fecha de envio],

     [@63:70] as [Fecha de cargo]

FROM

[..\Raw Data1\CBC_01042017.txt]

(fix, codepage is 1252);

I have a row at the end in the file which indicates the total value of the data. I wanted to delete that particular row while loading the source data. I have used enable transformation step and below code has been generated

'

(txt, codepage is 1252, no labels, delimiter is ' ', msq, no eof, filters(

Remove(Row, RowCnd(CellValue, 1, StrCnd(contain, 'T')))

));'

Since I am using the Fixed file I have removed the txt with fix (as I was using earlier),  now my code looks like below and it is throwing error.

LOAD [@1:2] as [Codigo Banco],

     [@11:25] as [Policy Number],

     [@44:52] as [Monto de cobro],

     [@55:62] as [Fecha de envio],

     [@63:70] as [Fecha de cargo]

FROM

[..\Raw Data1\CBC_01042017.txt]

(fix, codepage is 1252, no labels, delimiter is ' ', msq, no eof, filters(

Remove(Row, RowCnd(CellValue, 1, StrCnd(contain, 'T')))

));

Fixed File.PNG

attaching the sample raw data

1 Solution

Accepted Solutions
marcus_sommer

I think I would try something like this:

LOAD * where not wildmatch([Policy Number], '*T*');

LOAD [@1:2] as [Codigo Banco],

     [@11:25] as [Policy Number],

     [@44:52] as [Monto de cobro],

     [@55:62] as [Fecha de envio],

     [@63:70] as [Fecha de cargo]

FROM

[..\Raw Data1\CBC_01042017.txt]

(fix, codepage is 1252);

- Marcus

View solution in original post

2 Replies
marcus_sommer

I think I would try something like this:

LOAD * where not wildmatch([Policy Number], '*T*');

LOAD [@1:2] as [Codigo Banco],

     [@11:25] as [Policy Number],

     [@44:52] as [Monto de cobro],

     [@55:62] as [Fecha de envio],

     [@63:70] as [Fecha de cargo]

FROM

[..\Raw Data1\CBC_01042017.txt]

(fix, codepage is 1252);

- Marcus

gayatri7
Creator II
Creator II
Author

Hey Marcus,

Thanks for your quick reply. It works for me!!!!!!