thank you for reply but Is it possible to use a DOS batch script to remove extra spaces. The last field in the text file is 50 characters long in each record. "","00123450000000","LAMB KIDNEYS | 1KGM X 1........................... " I have a batch script running to generate the example file. One other small problem you might know. If I receive a file where someone has entered a comma in the text field is there a way to use a variable "%%n text field" in the batch to replace any comma with a space? This would help me greatly. Im learning fast....but only with your genius knowledge of Dos. Thanks for your help
Save the script as the name you like, then type e.g. mybat Your_FileName
and you get the filtered file in Your_FileName.new.
@echo off & setlocal EnableDelayedExpansion > "%~dpn1.new"
for /F "delims=" %%i in ('type "%~f1"') do (
for %%j in (%%~i) do set fld=!fld:,= ! %%j
set fld=!fld:" =",!
By the way this is NT batch, more powerful than plain DOS that doesn't exist in XP/Vista. Ah... the issue of comma is solved too.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.