cancel
Showing results for 
Search instead for 
Did you mean: 

How to eliminate empty lines in Flat file.

Former Member
0 Kudos

Hi All,

How to delete the empty lines in flat file,i am explaining below with data

Here we have 3 fields with field lengths 30,10,34 i am checking the condition in message mapping if the middle field containing 9999999999 i am deleting the total record but in output file i am getting empty line how to eleminate empy lines in file please suggest me is it possible through Content Convertion.

Thanks,

Sudheer.

0500189175247200000500003141700000142888073108000009640566210000

0500189175247200000500012449050000142889072908000009623017230000

0500189175247200000500000496210000142890073008000009631840760000

0500189175247200000500000162130000142891072808000009613028730000

0500189175247200000500001356750000142892072908000009621443430000

0500189175247200000500012982910000142893072908000009622158440000

0500189175247200000500001380990000142894073008000009631876720000

0500189175247200000500000074560000142895072808000009613904430000

0500189175247200000500003351650000142896072908000009623005030000

0500189175247200000500000061170000142898072808000009613026140000

0500189175247200000500000060590000142900073008000009630862400000

0500189175247200000500000155320000142901072908000009623234640000

0500189175247200000500043425220000142903072808000009612752160000

0500189175247200000500000517450000142904073108000009640911680000

0500189175247200000500006901140000142905073008000009630927540000

0500189175247200000500001565590000142906073008000009630938540000

0500189175247200000500000210440000142907073108000009640765850000

0500189175247200000500000187500000142908072908000009622980650000

0500189175247200000500000069240000142909072908000009622980660000

Accepted Solutions (0)

Answers (3)

Answers (3)

GabrielSagaya
Active Contributor
0 Kudos

Are you using Advanced UDF???

If the particular middle field matches 9999999999 then dont include result.addValues(middlefield[<i>]) or result.addContextChange() for that.

For rest alone include result.addValues(middleValue[<i>]);

Former Member
0 Kudos

Hi,

I think we could handle this with may be usage of Advanced UDF in Graphical mapping only.

Here as per the condition you are deleting the particular record but unknowingly blank value i.e. " " is getting passed so on target side blank node is created for this record.

You need to just avoid this blank Node.

If you can share the logic you have applied for Middle field as well the source and target structure I will be able to try the UDF code..based on it

Thanks

swarup

Shabarish_Nair
Active Contributor
0 Kudos

use a java mapping on the result payload and delete the empty line.

The use the file adapter to write the file out.