If you fix your report so it puts a ~ character at the end of the desired width, then you can fix your script to elimiminate ~CRLF. That should give you a fixed width file.
Dennis McGrath --- MikeB <[EMAIL PROTECTED]> wrote: > Ok.. I missed that. Any ascii text file can be processed by VbScript > or > JScript with the same precision as a compiled program and in fact may > have > advantages as scripting allows the mixing of the two languages in the > same job, > so you and leverage the strengths of each, if necessary. > > The method I displayed read the whole file in one gulp and removed > the Cr/Lf > pairs, however it could be processed line by line, padding or > replacing > characters as necessary. > > ----- Original Message ----- > From: "Jim Bentley" <[EMAIL PROTECTED]> > To: "RBASE-L Mailing List" <[email protected]> > Sent: Wednesday, May 18, 2005 7:39 AM > Subject: [RBASE-L] - RE: Cr/Lf in Dos Report > > > > Mike, > > > > Thanks for posting you vbs code. One minor glitch for what Troy > needed. The > > output record needs to be a fixed length. As processed each record > would be > > of variagle length. > > -- > > Sincerely, > > Jim Bentley > > American Celiac Society > > 266 Midway Dr > > River Ridge LA 70123 > > email: [EMAIL PROTECTED] > > Phone: 504-738-6165 > > > > > > > > > > -----Original Message----- > > From: MikeB <[EMAIL PROTECTED]> > > Sent: Sat, 14 May 2005 16:56:51 -0500 > > To: [email protected] (RBASE-L Mailing List) > > Subject: [RBASE-L] - RE: Cr/Lf in Dos Report > > > > Troy, > > > > Here is a VBScript that will work as well: > > > > 'Useage: WhateverFileNameYouUse.VBS > "FullyQualifiedFileNameToStrip" > > > > 'Note: The Source File is also the Target File, so only pass a copy > to be > > processed > > > > Dim WSH 'Script Host Object > > Dim FSO 'File System Object > > Dim TS 'TextStream > > Dim s > > Dim regEx 'Regular Expression Object > > > > Const ForReading = 1 > > Const ForWriting = 2 > > Const ForAppending = 8 > > Const TristateUseDefault = -2 > > Const TristateTrue = -1 > > Const TristateFalse = 0 > > > > if WScript.Arguments.count < 1 then > > wscript.Quit(1) > > end if > > > > Set FSO = CreateObject("Scripting.FileSystemObject") > > > > if FSO.FileExists(WScript.Arguments(0)) = True then > > FileIn = WScript.Arguments(0) > > else > > wscript.Quit(1) > > end if > > > > Set regEx = New RegExp ' Create regular expression. > > With regEx > > .Pattern = vbCrLf ' Set pattern of CR/LF pairs > > .IgnoreCase = True > > .Global = True 'replace all items found > > End With > > > > Set TS = FSO.OpenTextFile(FileIn, ForReading, False, TristateFalse) > > With TS > > While Not .AtEndOfStream > > s = regEx.Replace(TS.ReadAll, s) > > Wend > > End With > > > > TS.Close > > Set TS = FSO.OpenTextFile(FileIn, ForWriting, True) > > TS.WriteLine s > > TS.Close > > Set FSO = Nothing > > Set regEx = Nothing > > wscript.quit(0) > > > > > > > > ----- Original Message ----- > > From: "Troy Sosamon" <[EMAIL PROTECTED]> > > To: "RBASE-L Mailing List" <[email protected]> > > Sent: Saturday, May 14, 2005 3:17 PM > > Subject: [RBASE-L] - RE: Cr/Lf in Dos Report > > > > > >>I have written a Command Line EXE to strip all of the Cr/Lf > characters out > >> of a file. > >> If anyone needs it, I will be happy to give them a copy. E-mail > me > >> privately. > >> > >> Troy > >> > >> -----Original Message----- > >> From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of > Troy Sosamon > >> Sent: Saturday, May 14, 2005 12:27 PM > >> To: RBASE-L Mailing List > >> Subject: [RBASE-L] - RE: Cr/Lf in Dos Report > >> > >> That is correct. > >> > >> I need a fixed length record padded w/ spaces. I have been doing > NACHA > >> files for years, and no one ever had a problem w/ the cr/lf, now > an existing > >> client that is currently doing ACH submissions w/ the same bank is > opening a > >> new account, and the bank wants them taken out on the new account. > >> > >> It will only take me a couple of hours to write a VB program to > strip them > >> off, so it is not a big deal. > >> > >> Thanks, > >> > >> Troy > >> > >> -----Original Message----- > >> From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of > Jim Bentley > >> Sent: Friday, May 13, 2005 2:45 PM > >> To: RBASE-L Mailing List > >> Subject: [RBASE-L] - RE: Cr/Lf in Dos Report > >> > >> Troy, > >> > >> I can't think of a way to do this in RBase itself. > >> > >> Am I correct in assuming that you wish to create something > equivalent to an > >> IBM mainframe fixed lenth record. By this I mean that each record > (line) is > >> the same length ssay 85 characters and that the record is padded > with blanks > >> to the length of 85 when the last character is < 85. > >> > >> My favorite text editor "Kedit" from Mansfield Software Group > www.kedit.com > >> using the proper options can create the file you need. > >> -- > >> Sincerely, > >> Jim Bentley > >> American Celiac Society > >> 266 Midway Dr > >> River Ridge LA 70123 > >> email: [EMAIL PROTECTED] > >> Phone: 504-738-6165 > >> > >> > >> > >> > >> -----Original Message----- > >> From: Troy Sosamon <[EMAIL PROTECTED]> > >> Sent: Mon, 9 May 2005 18:47:53 -0600 > >> To: [email protected] (RBASE-L Mailing List) > >> Subject: [RBASE-L] - Cr/Lf in Dos Report > >> > >> > >> In R:base for Dos 6.5, I need to remove the Cr/Lf that the report > writer > >> puts at the end of every line of a report. > >> > >> Is there an easy way to do this? > >> > >> Thanks, > >> > >> Troy > >> > >> > > > > === message truncated === --- RBASE-L ================================================ TO POST A MESSAGE TO ALL MEMBERS: Send a plain text email to [email protected] (Don't use any of these words as your Subject: INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH, REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP) ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: INTRO ================================================ TO UNSUBSCRIBE: Send a plain text email to [email protected] In the message SUBJECT, put just one word: UNSUBSCRIBE ================================================ TO SEARCH ARCHIVES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: SEARCH-n (where n is the number of days). In the message body, place any text to search for. ================================================

