Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / August 2004

Tip: Looking for answers? Try searching our database.

csv and blank rows

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DJ - 31 Aug 2004 04:23 GMT
Hi, (and Thanks)

The task I am confronted with is to export specific csv files from Access.  
This is no problem.  The csv file, however, is required to always have 7
blank rows of data at the top.  How is this best done?

Regards,
John Nurick - 31 Aug 2004 07:17 GMT
Hi DJ,

A blank row in a CSV file would be something like this:

,,"","",,"",,

If that's what you want, you can get the result by creating a dummy
table with the same fields as the main table but containing just seven
null records. Then use a union query to combine the seven empty records
with the real ones, with an ORDER BY statement to ensure that the blank
records come first.

If you want seven empty lines at the start of the textfile, it's not
strictly speaking a CSV file (part of the definition is containing one
table with one optional header row and nothing else). One way to achieve
it is to create a textfile containing just the seven empty lines (e.g.
with Notepad) and store this in the same folder as the database. Then
export the data to a temporary file (e.g. "$$$DATA.TXT") and use
something like this to concatenate the two files and delete the temp
file:

    Shell "COPY ""D:\Appfolder\BlankLines.txt"" + " _
       & """D:\Folder\Sub folder\$$$DATA.TXT"" " +
       & """D:\Folder\Sub folder\My export file.txt"""
    Kill "D:\Folder\Sub folder\$$$DATA.TXT"

>Hi, (and Thanks)
>
[quoted text clipped - 3 lines]
>
>Regards,

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.