Hi James, Can you insert CHAR(160) as the 512th character? This will keep the preceding spaces and will show up as a blank. I don't know though whether the program that takes the file as input will tolerate that.
Regards, Stephen Markson The Pharmacy Examining Board of Canada 416.979.2431 x251 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of James W. Kim, CPA, MBA Sent: February-19-18 4:26 PM To: [email protected] Subject: [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 [email protected]. 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

