Personal I am using reports for this kind of functionality.
There is an option Print to Text File and there you are able to create complex 
TXT files and so on.

Tony


-----Oorspronkelijk bericht-----
Van: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com] Namens James W. 
Kim, CPA, MBA
Verzonden: maandag 19 februari 2018 22:26
Aan: rbase-l@googlegroups.com
Onderwerp: [RBASE-L] - Text file that retains trailing blank space

Need some help with creating text file that retains blank spaces at the end of 
each row.

I often need to create text files with fixed row length such as 512 or 750 
characters in a row. When there are no data value near the right end of each 
row, the unused spaces need to be filled with blank spaces.

The following is an example of how such text file would be built. The example 
creates a row that has "FLOOR 7" at 274th space in a row that has 512 
characters.  With some previous versions of R:Base, the trailing spaces is 
retained after insertion of data using SPUT function and line feed (CR/LF) 
would show up at 513th position.

However, the current version would remove the trailing space when data is 
inserted using SPUT function and the (CR/LF) moves up to 281st position.

Is there anyway I can force the retention of trailing spaces so that CR/LF 
always shows up at 513th position?

Thanks in advance,

James



-- create text variable with blank spaces SET VAR vRow TEXT = NULL SET VAR vRow 
= (SFIL((CHAR(32)),512))
-- use SPUT function to fill in data
SET VAR vRow = (SPUT(.vRow, 'start', 1)) SET VAR vRow = (SPUT(.vRow, 'Floor 7', 
274))

-- write the variable to a text file
OUTPUT sample.txt append
WRITE .vRow USING
'%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%'
OUTPUT SCREEN


-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rbase-l+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to