Export Report to txt file w/out Extra Lines

Robecca

Registered User.
Local time
Today, 11:22
Joined
Jan 5, 2013
Messages
68
A customer is requesting a .txt file from us to import into their new system. Here is their requested format:

H Unique 20161107 20161107
I 5500000021 110 4100000031 DBW1 20161107 2430848 LB 8010004405
SC 110 4100000062 LPT1 LB

It has to be 3 rows. Therefore, I need this to be a report and not a table. The data in purple changes daily based on the product shipped. However, my .txt files have blank lines above and below each row. Which does not import the data into the customer's system.

Is there a way to export a report to a .txt file without blank lines.

Thank you for any and all help! Robecca
 
Suggest use the filesystem object to create and populate the file

something like this (uses late binding so you do not need to add a reference

Code:
 Dim fso as Object
Dim expF as Object
Set fso = CreateObject("Scripting.FileSystemObject")
Set expF = fso.CreateTextFile(strPath)
With expF
     .WriteLine "H Unique 20161107 20161107"
    .WriteLine "I 5500000021 110 4100000031 DBW1 20161107 2430848 LB 8010004405"
    .WriteLine "SC 110 4100000062 LPT1 LB"
 wend 
expF.Close
Set expF=Nothing
Set fso=Nothing
 
Thanks CJ,

That is beyond my abilities, especially when data on each line changes daily.

What I finally figured out as a work around was to export the report as a RTF file, open it in Word and save as TXT. No more blank lines before each of my rows of data.

Appreciate your quick response to help!

Robecca
 

Users who are viewing this thread

Back
Top Bottom