AnsweredAssumed Answered

vrf-avioding string trim when reading a text file

Question asked by VRFuser on Mar 29, 2001
Hi!

I am trying to read a text file into 1D-array without losing any leading or
trailing space or tab characters.

1.I first used the I/O object From file (Read,Text,String format, Array 1D,
To end), it's very quick and doesn't use much memory, but it trims every row
in the text file.

2. I changed the settings of the From file object to (Read,Text,Char
format,Num of chars 1,to end) and then attached a to string object to
convert the 1D-array of chars to a 1D-array of strings (each row is a
string). With this solution I keep the leading and trailing space and tab
characters but it is extremely memory consuming. If I read a 690KB text file
VEE uses about 30MB. With solution 1 VEE uses about 1MB.

Question 1. How can I read a text file into 1D-array of strings without
losing leading and trailing space and tab characters and not using to much
memory?

Question 2. What is the reason to the large memory usage in solution 2?

Thanks in advance!


Best Regards

Stefan Westh

Metrology/ Development
Developer
--------------------------------------------------------------------
Celsius Metech AB
MTU
Box 1015
SE-732 26 ARBOGA
SWEDEN
Tel +46 589 82640
Fax +46 589 10740
http://www.celsiusmetech.com
mailto:stefan.westh@celsius.se




---------------------------------------------------------------------
This is the "vrf" maillist, managed by Majordomo.  To send messages to
this maillist, just email to "vrf@lvld.agilent.com".  Subscriptions and
unsubscriptions are done through the address "vrf-request@lvld.agilent.com".
If you need details, just send a message containing the text "help"
to "vrf-request@lvld.agilent.com".
---------------------------------------------------------------------

Outcomes