Results 1 to 11 of 11
  1. #1
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Export to txt (A2000)

    I'm looking for a way to export a series of data to a txt file.
    This has to be:
    ASCII, Comma Separated Values, Line Delimited Records.
    Fields are not fixed length.

    I assume this shortened means a CSV.

    Their should be 65 fields, many of which are blank.
    The file name must be :
    PLTRN.### starting from 001 and incrementing by one each time. ie:

    PLTRN.001
    PLTRN.002
    PLTRN.003 etc etc etc

    I had a quick look at exporting and sort of successfully managed to do so.
    I have a sample of the txt which, Is how I need it formatted;

    "10000","22012003","4","","","","","","","","","", "","","","","","","","","","","","","","","","","" ,"","","","","1236545","WT","5002","","","","","", "","","","","","","","",
    "","55","","","","","","","","","","","","","" ,""

    Heres how mine exports:

    "10000","22012003",4,0,,,,,,,,,,

  2. #2
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export to txt (A2000)

    Hi Hans

    "I noticed that one of the empty values gets exported as

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export to txt (A2000)

    <P ID="edit" class=small>(Edited by HansV on 29-Jan-03 13:59. Apparently I used a HTML reserved term in my reply causing it to display incorrectly. I substituted another term.)</P>Dave,

    I noticed that one of the empty values gets exported as

  4. #4
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export to txt (A2000)

    Hans
    I can't seem to get this right, am I doing something blatently obvious or am I going mad.

    p.s

    Did the
    Attached Files Attached Files

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export to txt (A2000)

    Hi Dave,

    Can you post it in Access 97 format? Otherwise, you'll have to wait until tomorrow (don't have Access XP where I am now).

    <img src=/w3timages/blueline.gif width=33% height=2>

    What caught my eye was that according to your post,
    "10000","22012003","4","","","","","","","","","", "","","","","","","","","","","","","","","","","" ,"","","","","1236545"
    was exported as
    "10000","22012003",4,0,,,,,,,,,,

  6. #6
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export to txt (A2000)

    Here you go 97 format with missing ref's.

    ------------------------------------------------------------------------------------------

    Not sure how that happened, maybe a Phenomominominom !!! <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Attached Files Attached Files

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export to txt (A2000)

    Dave,

    Had no problem with missing references. What was missing, though, was the export specification - perhaps it didn't survive the conversion to Access 97.

    I created a new export specification DavesExportSpec. I also modified the code a bit - I found that I had to specify the path of the renamed file explicitly, otherwise it was moved to my default Access folder.

    I have attached the modified Access 97 database, together with a text file exported by clicking the button on the form.
    Attached Files Attached Files

  8. #8
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export to txt (A2000)

    Perfect
    Thanks again Hans <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  9. #9
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export to txt (A2000)

    Not sure if this makes a difference, but.
    Checking the PLTRN files on the server which I'm trying to reproduce, they have been saved in Notepad format.
    ( attached shows the originals and properties)
    Will this make a difference when importing from Sage ??
    Attached Files Attached Files

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export to txt (A2000)

    In the first place, you are hiding file extensions for known file types. I strongly recommend that you change this - in Windows Explorer, select View/Folder Options... or Tools/Folder Options... (I forget which one it is in Windows XP), View tab, uncheck Hide file extensions for known file types. It is always better to know the exact name of a file you're dealing with. Some of the e-mail viruses that caused a lot of damage a couple of years ago relied on the fact that most users hide extensions to disguise a VBScript file as a Word document or JPEG image.

    In the second place, files with extension .001, .002 etc. have no program associated with them by default. If you try to open such a file from the Explorer, Windows asks which application you want to use to open it. If you select Notepad and click OK, Windows will then use Notepad for *all* files with that extension unless you uncheck an option that is On by default). I guess that's what happened on your PC. It will make *no* difference for the content of the files.

  11. #11
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export to txt (A2000)

    Thanks again, Points taken and sorted.
    Checked the masters on the server and they are of the same as reproduced from Access.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •