Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I have to submit a UPS manifest every day which requires a long TXT full of shipping information to be sent to them.
The old computer I was using had a special program to do it, but my new one just grabs the file via FTP and then resends it to UPS. Unfortunately UPS needs all of the data on one line.
Is there any way to replace ALL carriage returns within a file with a "space" or possibly just to delete them? Any/all hope will be greatly appreciated.
Thank you!
Robert Fischer.

I have looked at that issue a dozen times without any simple answer. I'd like to know it.
The only way I know of is to run it in a binary file editor and get them out that way. Used to be able to do it from a command line on an old OS. There are some VB script out that that may work. Some pages show a way to use a text editor but I have had little luck with that.
I read it wrong and answer it wrong too. So get off my case you goober.

@echo off > newfile
setLocal EnableDelayedExpansionfor /f "tokens=* delims= " %%a in (myfile) do (
set s=!s!%%a
)
echo !s! >> newfile
=====================================
If at first you don't succeed, you're about average.M2

VBScript may be better if you can't have a line return at the end or if the file is around 8K+:
With CreateObject("Scripting.FileSystemObject")
Set fOut = .CreateTextFile("newfile", True)
With .OpenTextFile("myfile", 1, False)
Do Until .AtEndOfStream
fOut.Write .ReadLine
Loop
End With
End With

This is regadarding Mechanix2
It seems to work for 8KB but the file I am working with is a 250,000 character TXT file.
Is there any way you could have it work with a file of this size?
thank you thank you!!
Robert
>@echo off > newfile
>setLocal EnableDelayedExpansion
>for /f "tokens=* delims= " %%a in (myfile) >do (
>set s=!s!%%a
>)
>echo !s! >> newfileRobert Fischer.

Sorry, I am unfamiliar with how to run or manipulate VB script. Is it possible to make an executable out of it?
Thank you very much,
Robert
Robert Fischer.

1) Save the colored text as whatever.vbs
2) Replace the red colored text with the relevant information. In this case, the first one is the output file name, and the second is the source name. (They cannot be the same.)
3) Run it! Do it either from a batch file (whatever.vbs), or straight up (double-click on the icon). If you run it from a batch file, the batch will wait for the VBScript to end, so you don't have to worry about that.

![]() |
Strange problem with Exce...
|
some installers reboot co...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |