problem with tFileOutputPositional

One Star

problem with tFileOutputPositional

I'm tried to create a text file filled with data from a database using tfileOutputPositional. Job work correctly, but if i open file with Notepad his content is not formatted. How can i solve this issue? (See image below)

Notice: If I open file with MFC Wordpad e save it as "Text Document - MS-DOS format", when reopen file, it is formatted correctly.
One Star

Re: problem with tFileOutputPositional

hi,
may be an end line character not recognize by notepad,
did you try with ultraedit or other ??
One Star

Re: problem with tFileOutputPositional

hi,
may be an end line character not recognize by notepad,
did you try with ultraedit or other ??

if I open with another text editor it view correctly. I have observed, that if I open with microsoft wordpad (do you know?) and save as "Text Document - MSDOS Format", and open it again with notepad it view correctly.
One Star

Re: problem with tFileOutputPositional

I'm tried to create a text file filled with data from a database using tfileOutputPositional. Job work correctly, but if i open file with Notepad his content is not formatted. How can i solve this issue? (See image below)
Notice: If I open file with MFC Wordpad e save it as "Text Document - MS-DOS format", when reopen file, it is formatted correctly.

I have tried this solution with TOS 2.1.1 and it works.
use "\r\n" as row separator in your modules tFileOutputPositional
to change existing modules tFileOutputPositional you have to edit the jet-files (ex with Wordpad).
You can find this files here:
\plugins\org.talend.designer.components.localprovider_???\components\ tFileOutputPositional\tFileOutputPositional_main.???

Replace : sb_tFileOutputPositional_1.append("\n"); by sb_tFileOutputPositional_1.append("\r\n");
Notice : CRLF, acronyme de Carriage Return ("\r" retour chariot) + Line Feed ("\n" saut de ligne) = "\r\n"
One Star

Re: problem with tFileOutputPositional

I'm tried to create a text file filled with data from a database using tfileOutputPositional. Job work correctly, but if i open file with Notepad his content is not formatted. How can i solve this issue? (See image below)

Notice: If I open file with MFC Wordpad e save it as "Text Document - MS-DOS format", when reopen file, it is formatted correctly.

I have tried this solution with TOS 2.1.1 and it works.

use "\r\n" as row separator in your modules tFileOutputPositional

to change existing modules tFileOutputPositional you have to edit the jet-files (ex with Wordpad).
You can find this files here:
\plugins\org.talend.designer.components.localprovider_???\components\ tFileOutputPositional\tFileOutputPositional_main.???


Replace : sb_tFileOutputPositional_1.append("\n"); by sb_tFileOutputPositional_1.append("\r\n");

Notice : CRLF, acronyme de Carriage Return ("\r" retour chariot) + Line Feed ("\n" saut de ligne) = "\r\n"
Wonderful!!! I have tried this solution right now and it works!!!
file .javajet was lightly different, it was:

...

//get and format output String end
<%
}
%>
sb_<%=cid %>.append("\n");
out<%=cid %>.write(sb_<%=cid %>.toString());
nb_line_<%=cid %>++;
<%
}
...

and i have replaced "sb_<%=cid %>.append("\n");" line by "sb_<%=cid %>.append("\r\n");"

Thank you very much!!!
One Star

Re: problem with tFileOutputPositional

Is this a general problem? If so, I think it make sense to open a bug / feature request: Creating linebreaks in dependency to the operating system (unix / dos) / or alternatively give a option to the component to decide it.
One Star

Re: problem with tFileOutputPositional

Is this a general problem? If so, I think it make sense to open a bug / feature request: Creating linebreaks in dependency to the operating system (unix / dos) / or alternatively give a option to the component to decide it.

This is a general problem. I will create a bug/feature request today.

Cheers, Kaiser.
Employee

Re: problem with tFileOutputPositional

Hello
This feature has already be opened 1680
Regards,
Michaël.
One Star

Re: problem with tFileOutputPositional

Hello Michaël,
thanks for the information. I don't know how the detailed resolution looks like, but I think it would be user friendly if:
* The default (prefilled in the gui) is set to the system-specific value (but there is a problem with different systems for generating / executing the script).
* I f you enter nothing, talend would use system specific linebreaks.
* Give a flag to select "use system specific linebreak".
So the user don't have to be worry about the operating system and special behaviors.
Bye
Volker
One Star

Re: problem with tFileOutputPositional

Hello

This feature has already be opened 1680

Regards,
Michaël.

too late!!! I have added a new bug in bugtracker.
Employee

Re: problem with tFileOutputPositional

thanks for the information. I don't know how the detailed resolution looks like, but I think it would be user friendly if:
* The default (prefilled in the gui) is set to the system-specific value (but there is a problem with different systems for generating / executing the script).
* I f you enter nothing, talend would use system specific linebreaks.
* Give a flag to select "use system specific linebreak".
So the user don't have to be worry about the operating system and special behaviors.

Like in all TOS File components : default will be "\n" and user can specify is own.
This is the general mechanism of the row separator property.
Michaël.