Export presort using original CSV's file names

Exporting expressions and information including exporting data in presort order or import order, and importing information, along with error messages that may apply to this category.

Moderators: Steve, Terry, Donna, Dave, Eric, MartyH, Kristen, Chrissy, Geoff, Vince

Post Reply
User avatar
Posts: 1912
Joined: Tue Sep 19, 2006 3:29 pm

Export presort using original CSV's file names

Post by Eric » Fri Nov 28, 2008 9:54 am

We have create a simple to use Utility Program that will use the “Original Header” record from a CSV Input File (any), then add the “additional” fields added by AccuZIP6 5.0, including any presort fields to a new CSV in Presort order.

Please download writeoutputcsv.zip and unzip to the root level of the AccuZIP6 5.0 folder, e.g., C:\Program Files\AccuZIP6 5.0\WriteOutputCsv.fxp

Follow the simple steps below to create a new CSV with your Original Field names and additional fields in Presort Order:
1. Open AccuZIP6 5.0.
2. Use the File|Open List to open your original Input File.
3. Validate and Presort the list.
4. Once the file is presorted, click “Print Labels” from the Print Presort window. This generates the Presort.prt
5. Close the Print Presort window
6. From the Edit menu, choose Command…
7. Click New and give the command a name, e.g., Write New CSV with Original Field Names
8. Press TAB and type the following syntax in the large box:

Code: Select all

9. Click Run
10. You Prompt #1 – Locate Original Input CSV with long field names in header
Note: This is the file you opened with Open List
Prompt #2 – Locate Presort.prt inside last Presort Folder
The Presort folder and Presort.prt file were created during the presort
Prompt #3 – Give the new CSV a Name
Note: This is the resulting CSV file that will contain the long file names[/color]

You can also use the Utility Program with parameters to suppress the prompts:

Code: Select all

=WriteOutputCsv("c:\demofile.csv","c:\presort folder\presort.prt","c:\demofile clean.csv")
You can also leave a parameter blank so you are prompted. Say you want to be prompted for the Presort.prt (second parameter):

Code: Select all

=WriteOutputCsv("c:\demofile.csv","","c:\demofile clean.csv")
The beauty is that you can use the same Input file all the time. If you have an input file that matches the Headers you always use, then point to it each time in first parameter. If you want to always save the final result to the same location, then enter the path where you always want it saved.

You can also have the software always use the Current Databases name with a Date Stamp saved to the same folder, like this:

Code: Select all

=WriteOutputCsv("c:\demofile.csv"," c:\presort folder\presort.prt ",FORCEEXT(DBF(),"")+ALLTRIM(STR(YEAR(DATE())))+PADL(ALLTRIM(STR(MONTH(DATE()))),2,"0")+PADL(ALLTRIM(STR(DAY(DATE()))),2,"0"))
Chat with an AccuZIP6 technician weekdays from 7-4 PST with AccuZIP6 Live Online Support

Post Reply