Newbie Question

Hi,

The questions I have read so far in this list are a ittle above my head at

this stage, but I will press on.

Can someone tell me how I can append one File object to the end of another

one? Is it possible to add two File objects together as if they were

strings? Eg, if we have FileA and FileB, both containing a text file:

FileA = FileA + FileB

Would this work?

Regards,

Charlie Williams.

[459 byte] By [] at [2007-11-25 5:01:54]
# 1

Charlie.Williams@ecsoft.co.uk wrote:

> Hi,

>

> The questions I have read so far in this list are a ittle above my head at

> this stage, but I will press on.

>

> Can someone tell me how I can append one File object to the end of another

> one? Is it possible to add two File objects together as if they were

> strings? Eg, if we have FileA and FileB, both containing a text file:

>

> FileA = FileA + FileB

>

> Would this work?

>

> Regards,

>

> Charlie Williams.

No.

Several ways will work depending on size you could determine.

One is reading one file in and writing or appending it to the other.

You could read each in as text and use the .concat method if you chose before

writing it back out.

at 2007-6-29 9:22:05 > top of Java-index,Application & Integration Servers,Integration Servers...
# 2

Ok, if I have data in a BinaryData object which I want to transfer to a

FileText object, how would I do this?

Basically, I have a problem in that currently some code reads a file from

UNIX file system into a FileText object and then transfers it across

various media until ultimately it reaches a DOS system. When it reaches the

DOS system some client software picks it up and tries to read it

line-by-line.

Now, it cannot read it line by line because the file, when opened by the

client software, is in one big line - it appears when a file is read from

UNIX by Forte into a FileText object, it loses all the carriage returns,

hence the physical file appearing at the other end as a big long line.

So I was thinking - what if I read the UNIX file into a BinaryData object

instead, thereby reading every character arbitrarily and stripping nothing

out. Then maybe I could copy the data from the BinaryData object over to

the FileText object at the point where it is sent off. Any ideas? Or have I

got the wrong end of the stick?

PS: I repeat - I am a newbie with Forte so don't be afraid to tell me I am

completely wrong!

Charlie.

at 2007-6-29 9:22:05 > top of Java-index,Application & Integration Servers,Integration Servers...
# 3

>

>

>

>

> Ok, if I have data in a BinaryData object which I want to transfer to

a

> FileText object, how would I do this?

>

> Basically, I have a problem in that currently some code reads a file

from

> UNIX file system into a FileText object and then transfers it across

> various media until ultimately it reaches a DOS system. When it

reaches the

> DOS system some client software picks it up and tries to read it

> line-by-line.

>

> Now, it cannot read it line by line because the file, when opened by

the

> client software, is in one big line - it appears when a file is read

from

> UNIX by Forte into a FileText object, it loses all the carriage

returns,

> hence the physical file appearing at the other end as a big long line.

>

> So I was thinking - what if I read the UNIX file into a BinaryData

object

> instead, thereby reading every character arbitrarily and stripping

nothing

> out. Then maybe I could copy the data from the BinaryData object over

to

> the FileText object at the point where it is sent off. Any ideas? Or

have I

> got the wrong end of the stick?

>

> PS: I repeat - I am a newbie with Forte so don't be afraid to tell me

I am

> completely wrong!

>

> Charlie.

>

>

This isn't a Forte problem. It is a difference in line handling

protocol between UNIX and DOS. Unix delimits lines with a newline

character and DOS uses carriage return + newline. If the file was

created in the UNIX world and you want to display it as Wintel lines

you need to convert each newlines to carriage return + newline. If

you FTP a unix text file to DOS in ASCII mode it adds the CR. If you

FTP in binary mode you will get it all on one line.

The same thing works the other way. If you FTP a DOS text file without

using ASCII mode to UNIX then you will find a ^M at the end of each

line.

It rather sounds like you should process your Unix text file using

one of the line-oriented methods and put in trailing CR's if you intend

to display the file in a Wintel application.

sporterfield@longs.com

at 2007-6-29 9:22:05 > top of Java-index,Application & Integration Servers,Integration Servers...
# 4

Thank for all the replies so far, they have been very enlightening. I feel

slightly more competent already!

One more thing - does anyone know of a good internet resource for Forte

documentation and help? Maybe some good web-sites or a fax-back facility?

There are some areas of Forte I need to know about that are not in the

online help.

Charlie Williams.

at 2007-6-29 9:22:05 > top of Java-index,Application & Integration Servers,Integration Servers...
# 5

Charlie,

There are some things in the documentation that are not in the online help

and visa-versa. Also try <a href=

"http://www.forte.com/tech">http://www.forte.com/tech</a> as a rich source of

information. You will need to register and get a logon.

Regards,

Richard Stobart

Technical Consultant for Forté

E-mailRichardStobart@mail.com

Quick-mail:0832691942@sms.mtn.co.za

Voice:(+ 27 83) 269 1942

(+27 11) 456 2238

Fax:(+ 27 83) 8269 1942

--Original Message--

From:Charlie.Williams@ecsoft.co.uk [SMTP:Charlie.Williams@ecsoft.co.uk]

Sent:Monday, January 26, 1998 12:37 PM

To: Forte-Users@sagesoln.com

Subject:Re: Newbie Question

Thank for all the replies so far, they have been very enlightening. I feel

slightly more competent already!

One more thing - does anyone know of a good internet resource for Forte

documentation and help? Maybe some good web-sites or a fax-back facility?

There are some areas of Forte I need to know about that are not in the

online help.

Charlie Williams.

at 2007-6-29 9:22:05 > top of Java-index,Application & Integration Servers,Integration Servers...