Renerabbitt Posted August 11, 2023 Share Posted August 11, 2023 Why when I script a macro to read from a CSV the reported value looks like this in regular text whereas it works perfectly in rich text: Link to comment Share on other sites More sharing options...
Chopsaw Posted August 12, 2023 Share Posted August 12, 2023 That seems like a pretty good reason to use Rich Text. Any sort of inconsistency with that CSV that might be carrying through ? Line one is not so great but line thee looks fine. Link to comment Share on other sites More sharing options...
SHCanada2 Posted August 12, 2023 Share Posted August 12, 2023 i'd throw in a \n at the beginning of the buffer variable you are writing out, to see if that makes a difference as it looks to only occur on the first line Link to comment Share on other sites More sharing options...
Renerabbitt Posted August 14, 2023 Author Share Posted August 14, 2023 On 8/11/2023 at 6:29 PM, Chopsaw said: That seems like a pretty good reason to use Rich Text. Any sort of inconsistency with that CSV that might be carrying through ? Line one is not so great but line thee looks fine. On 8/11/2023 at 9:11 PM, SHCanada2 said: i'd throw in a \n at the beginning of the buffer variable you are writing out, to see if that makes a difference as it looks to only occur on the first line Switched to tab breaks and its even worse...seems to be duplicating data..this has to be a bug .Also tried a new line to start and that doesnt change anything Link to comment Share on other sites More sharing options...
Joe_Carrick Posted August 14, 2023 Share Posted August 14, 2023 The simple answer is csv's have some control characters which: Rich Text understands correctly. Standard Text doesn't. in your case it's probably a control character that standard text thinks is a backspace. It's for that reason that I use txt files which I can read and display in either. btw, Rich Text is almost superfluous for macro output since it can only apply to the entire string (every line). IOW, you will just get one text style. 1 Link to comment Share on other sites More sharing options...
SHCanada2 Posted August 21, 2023 Share Posted August 21, 2023 On 8/14/2023 at 11:29 AM, Renerabbitt said: Switched to tab breaks and its even worse...seems to be duplicating data..this has to be a bug post the CSV you can view it in a hex editor to see if there is anything funny. However if you just open up a new text file in notepad and type in the chracters with commas, and then save it, and then see if you still get the error, To check your code, you could just read the first character in the newly created file from above, and see if it is screwed up. Not sure how you are reading the file, It is odd it works for the second line but not the first. I would also try adding a line break in the CSV file on the first line to see if that makes a difference. I thought it might be the character encoding set, but that doesnt really make sense if the second line is interpreted correctly. It's almost like the CA rich text box processing of the returned macro result, is thinking it is part of the rich text encoding. The other thing you could do to check that is to print out the first line's buffer again, after the good second line is printed Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now