cancel
Showing results for 
Search instead for 
Did you mean: 

Blank line at end of file

0 Kudos

Hi

I am using content conversion at the receiver channel. All is fine with the records being written into the file.

However one additional blank line gets written at the end of file (if file is checked in notepad / notepad++)

The client does not accept this and needs a solution.

Please can the experts suggest what can be done to avoid this and make the cursor stay at the end of last record

The content conversion definition is as follows

ignoreRecordsetName            true
DT_XXXX.keepIncompleteFields YES
DT_XXXX.fieldNamesField1,Field2,Field3,Field4,Field5
DT_XXXX.fieldSeparator,
DT_XXXX.missingLastFields add
DT_XXXX.endSeparator'nl'

The output when opened with notepad is as below

Row1

Row2

Row3

|               (this pipe represents the cursor at the start of the blank line)

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Giresh,

what is the file type you mentioned in the Processing parameters. if its Text then change it to Binary and see the magic .

Cheers

Hidayat

Former Member
0 Kudos

Hi Giresh,

Please try '0x0a' for endSeparator . It worked for me .

Regards,

Rudra

Former Member
0 Kudos

Hello Giresh,

Use endSeparator = '0' it will resolve your issue.

Regards,

Sriprasad Bhat

Former Member
0 Kudos

Hi Sriprasad

When I use endSeparator as '0' the 2 records come into 1 line.

I changed the endSeparator to \n :-

By doing this the # at the end of each row has now disappeared, but I still get the blank line as the last row

ambrish_mishra
Active Contributor
0 Kudos

Hi Girish,

Did you try the solution I suggested.

Ambrish

Former Member
0 Kudos

This message was moderated.

0 Kudos

Hi Ambrish

Please can you let me know how to acheive the backspace character in mapping to populate on last line

ambrish_mishra
Active Contributor
0 Kudos

Hi,

Just populate an extra line (duplicate subtree), map to a constant blank. Populate first field like I suggested and see how it goes.

Ambrish

0 Kudos

Hi Ambrish

I populated the first field as suggested by you.

Now I get a line in the file with '0x08' on the last line.

Please suggest solution.

Regards

Former Member
0 Kudos

Hello Giresh,

Try using missingLastFields = ignore  in place of add.

Regards

Gaurav Ranjan

rodrigoalejandro_pertierr
Active Contributor
0 Kudos
ambrish_mishra
Active Contributor
0 Kudos

Hi Giresh,

You can try to create one extra row in mapping and populate a backspace ('0x08') in the first field and not populate other fields.

It may work!

Ambrish

rodrigoalejandro_pertierr
Active Contributor
0 Kudos