James I have a file that contains the use of SFIL and SPUT. I used this to provide a class listing to a health insurance company. It's about 11 years old but I think it should still work.
Buddy -----Original Message----- From: rbase-l@googlegroups.com [mailto:rbase-l@googlegroups.com] On Behalf Of James W. Kim, CPA, MBA Sent: Monday, February 19, 2018 4:26 PM To: rbase-l@googlegroups.com 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 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.