cancel
Showing results for 
Search instead for 
Did you mean: 

Trimming spaces

Jim_Holzer
Champ on-the-rise
Champ on-the-rise

Hi All:

I'm trying to DIP files into OnBase from another LOB application.  The file names of those documents were stored on the file share with "spaces" in the documents names.  If I try to bring them in using an Ordered DIP process - the process fails as soon as it hits a space in the document's name.  Is there a way to remove/trim spaces from a docments name?

e.g.

\onbaseDG$\DIPProcess\DOC_20131125\0005821_INTAKEREPORTS (M 311).RTF

I want to remove the spaces between the "s (" and between "M 3" above.

 

3 REPLIES 3

Jay_Gienty
Champ on-the-rise
Champ on-the-rise

REM This file will remove all instances of " and append the path and filename


@echo off > OUTPUTFILE.txt & setLocal enableDELAYedeXpansion
for /f "tokens=* delims= " %%a in (INPUTFILE.txt) do (
set S=%%a
set S=!S:"=!
>> OUTPUTFILE.txt echo.!S!
)

Jay_Gienty
Champ on-the-rise
Champ on-the-rise

Sorry - This was supposed to paste below this.  We use this Batch file to remove " characters. It might work for spaces.  Jay

Roger_Walker
Star Collaborator
Star Collaborator

Hi Jim,

Is your DIP index file created using Field Delimiters?

If you are using delimiters, filenames with spaces should not be an issue.

As an example, an index file that looks like this, using the double quote delimiter and comma separator imports correctly:

"Photo","Bob Hope","1-1-1970","\\dev-011316\TestData\DIP\Spaces Spaces\File 1.tif"
"Photo","Bill Cosby","2-28-1990","\\dev-011316\TestData\DIP\Spaces Spaces\File 2 .bmp"
"Photo","Brad Pitt","12-2-2001","\\dev-011316\TestData\DIP\Spaces Spaces\File   3  .bmp"

 Thanks for using Community!

Roger