Results 1 to 6 of 6
  1. #1
    jpfulton248 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2014
    Posts
    4

    Export Fixed Width with No Line Breaks/Carriage Returns

    I'm trying to figure out how to export a Query in a fixed width text file format with no line breaks. I have everything set up and saved in "Specs" so I'm on the 1 yard line but can't figure out how to stop line breaks from exporting (maybe there isn't away)?



    I'm using Access 2003.

    Thanks in advance!!

    Pete

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Why are line breaks an issue? Shouldn't the text file have multiple lines?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jpfulton248 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2014
    Posts
    4
    The problem is that the export is the first step in a multi-step process involving 16bit DOS based executables originally written in Fortran.

    My hope was to eliminate step 2 from below:


    1. Step 1 is the export (formerly tab delimited)
    2. Step 2 is an exe that converts tab delim to fixed width with no line breaks
    3. Step 3 is another exe file
    4. Step 4 is another one
    5. Step 5 is another one that creates a postscript file.


    In order to skip step 2 I need to have a fixed field file that will seamlessly feed into step 3. This is all just a matter of convenience, I can continue with the orig workflow but step 2 is a bit of a pain in the a$$ (I have to enter the char width of 75 fields at the command prompt in DOS individually every time I run a draft of this postscript file... and the char widths NEVER change and haven't in 15 years).

    Thanks again.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I am still not understanding the 'no line breaks'. You want to data to be one long, continuous string?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    jpfulton248 is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2014
    Posts
    4
    Quote Originally Posted by June7 View Post
    I am still not understanding the 'no line breaks'. You want to data to be one long, continuous string?
    I know it sounds weird, but yes, that is the way the Step 3 executable was written... it expects no line breaks.

    So the total character width of the export is 1900 characters comprised of 75 fields. I think the way it works is that when it gets to 1900 it automatically knows that it has reached a new record. I took the fixed field with line breaks into a text editor and find/replaced for breaks... this created a "good" file so I know the only thing I'm missing is the ability to export without the breaks. Just hoping to streamline it a bit.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Are you trying to eliminate carriage returns, or line feeds? typically in a text file a 'line break' is a carriage return/line feed pair. Some systems will not read one or the other of those or interpret them as the same thing, in essence creating a 'blank' line.

    If you are attempting to export a query or table with just a line feed (typically if you were to try to import a file that only had a line feed as the end of line character into access it would look like one great big long string which is what I think you're after) you will likely have to write a VBA script to handle the width you're talking about as I don't think you can build it into access (access doesn't like stuff wider than 255 characters and I'm not sure a total width of 1900 wouldn't make it scream for mercy).

    a vba script to perform the export for you wouldn't be too hard though and would be much easier if you had a table defining field widths it could read.

    Look at the filesystemobject method for creating a text file and writing to it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 15
    Last Post: 08-12-2013, 07:27 PM
  2. Replace Carriage Returns with Spaces
    By chitan in forum Queries
    Replies: 1
    Last Post: 12-15-2011, 11:14 AM
  3. Removing all carriage returns from a database
    By Yesideez in forum Access
    Replies: 2
    Last Post: 06-26-2011, 09:55 AM
  4. export query to fixed width text
    By eladz949 in forum Import/Export Data
    Replies: 1
    Last Post: 02-08-2011, 07:28 AM
  5. export query to fixed width text
    By eladz949 in forum Import/Export Data
    Replies: 5
    Last Post: 01-01-2011, 03:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums