hostwizard.blogg.se

Remove carriage return word mac
Remove carriage return word mac









remove carriage return word mac

Although we could probably get by with stripping away just the linefeed character we’re going to do things nice and neat and get rid of both characters. Why the last two characters? Well, the carriage return-linefeed actually consists of two separate characters: the carriage return (with an ASCII value of 13) and the linefeed (with an ASCII value of 10).

remove carriage return word mac

We’re going to grab the last two characters stored in that variable.

remove carriage return word mac

We’re going to open the file and read the contents of that file into a variable named strFile. So how are we going to get rid of that pesky little carriage return-linefeed? Here’s how: You might not see anything on the screen, but it’s there and it’s creating problems: That’s because there’s a carriage return-linefeed immediately following the period (as if someone typed in the first line and then pressed ENTER). Note that the cursor does not appear immediately after the period in line 1 instead, the cursor appears at the beginning of line 2. We opened the file and then pressed Ctrl+End to position the cursor at the end of the file. What does all that mean? Well, consider the simple little text file below. Unfortunately, though, the text file invariably has a carriage return-linefeed at the end, and that carriage return-linefeed is causing problems when you try passing the contents of the file as a query. From the rest of your email you note that you’re using the FileSystemObject to read a text file, then using the contents of that text file as a query in another application. Hey, Scripting Guy! How can I remove the last carriage return-linefeed in a text file?











Remove carriage return word mac