cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove blank spaces from file before writing on FTP Server?

Former Member
0 Kudos

Hi All,

I am using File content conversion. My mapping is having only one field which is string. Now I dont know what will be the size (In Char ) of this string, as it is variable.

Also as we have to use FixedfieldLengths or field Separator I am using Fixed field lengths. I have randomly specified the length 500char as I know input string will not be greater than that.

But because of this 500char, even though the input string is less than that (Let us assume 100 char) while writing file it writes 100char of actuall string and 400char blank space.

Due to this(For eg) even though input file is of 7MB the out file becomes 30MB.

Which is huge difference.

I tried with trim function, and fieldcontentformatting = TRIM. But still problem exists.

Can anybody will help me to solve this problem?

Warm Regards,

Gouri

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

<i>Also as we have to use FixedfieldLengths or field Separator I am using Fixed field lengths</i>

>>

remove FixedfieldLengths and use fieldSeparator as 'nl'

that sud solve your problem

Former Member
0 Kudos

I tried with that. I used end separator as 'nl'. But still that problem exists.

And I have alredy tried with TRIM funtion in mapping. Still problem exists.

Warm Regards,

Gouri

bhavesh_kantilal
Active Contributor
0 Kudos

Use fieldSeparator instead of fixedFieldLength and this would do the trick.

Regards

Bhavesh

Shabarish_Nair
Active Contributor
0 Kudos

can you paste the FCC parameters you are using in the adapter here.

The fieldSeparator option will not add spaces (in case there are already spaces in your target field in mapping then it will. In that case you will have to trim the spaces in the mapping) so use that option. It will work !!!!

Former Member
0 Kudos

Thanks everybody.

Thanks Bhavesh. I was trying field separator as comma. Never thought abt nl. it is working fine. Thanks a lot.

Points awarded.............:)

Warm Regards,

Gouri

Former Member
0 Kudos

Hi Gouri,

I am facing the same problem that u solved.

Could u please forward u r FCC parameters to resolve this issue.

becuse of this blank places our file size also incresing too large.

Expecting quick reply

thanks & regards

siva

Former Member
0 Kudos

Hi Gouri Joshi

please help me from getting out this problem

could u please provide u FCC parameters as i am facing same problem

Have u used trim function also?

could u please explain how to use that

thanks&regards

Siva

Former Member
0 Kudos

Extremely sorry for late reply. Just now saw your mail.

As suggested by Bhavesh, I have given field separator = 'nl'.

If you can give details of your FCC I will be able to suggest more.

-Gouri

Former Member
0 Kudos

Hi Gouri,

Thanks for the reponse. But still problem is not solved completely. When we down load the file into FTP Server, one blank line is appearing at the end of the file which is incorrect. Please see the FCC parameters in our scenario.

<b>Record Set strucure</b> Data, Header

Data.addHeaderLine 0

Data.fixedLengthTooShortHandling Cut

Data.fieldSeparator 'nl'

Header.addHeaderLine 0

Header.fieldFixedLengths 0

Header.fixedLengthTooShortHandling Cut

Header.endSeparator '0'

I think, due to Data.fieldSeparator, the cursor is going to next line which is infact a blank line. Instead the cursor should be positioned at the end of the file only.

Former Member
0 Kudos

Hi Gouri,

Could you please give your contact number which will be a great helpful to me.

Former Member
0 Kudos

The FCC parameter what I had used,

Structure.fieldNames DataRecord

Structure.fieldSeparator 'nl'

Structure.ProcessFieldNames fromConfiguration

These 3 parameters only I have used.

Just try with these parameters and check the file size. I think with this there should not be any difference in file size. If it is there plz let me know.

-Gouri

Former Member
0 Kudos

Hi Gouri,

Thanks for the reply.

I have used the structure.fieldSeparator 'nl' which seems to solved the problem. But strangely If I open the file in FTP Server Iam getting one extra line at end of file.

If I open the same in Windows there is no extra line ..its fine.

Actually what happens here is, after displaying the data the cursor is going to next line to print the header which is not required in our case. Hence it is appearing as a blank line. Instead If we write the header also, we r not getting any blank line.

Thanks,

Jitender & Siva

Former Member
0 Kudos

Hi,

Could any one help us in this.

We need to remove the exta CR/LF line from the file.

Many Thanks in Advance,

Jitender

Answers (1)

Answers (1)

former_member181959
Contributor
0 Kudos

Hi,

May be you can try using trim UDF in the mapping program.

Prasad