Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Export a fixed length file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Export a fixed length file

    Hi all

    I want to export a file to our accounts package (Sun Accounts) but the file format is very specific it is as follows
    Field Name Field Lenght
    Account No , 15
    period , 7
    invoice date ,10 "yyyymmdd+2
    a field , 15 (always M)
    net value , 18 (no decimal place 28.20 = 2820
    Debit , 2 (always D)
    a field , 5 (always "captn")
    a field , 15 (always "captn")
    invoice No , 15
    invoice , 25 (always word invoice)
    todays date , 8 "yyyymmdd"
    period , 251

    This is then repeated for our vat total

    The report is by ACCOUNT, DEPOT , NOMINAL CODE

    Has any body any idea how i can produce the file


    kind regards

    Andy

  • #2
    Need a sample table

    This can be done fairly easily. Attach a sample and I'll work something up.

    I am attaching an example of a table approximately matching your specification and a script that will export the data to a file named test.txt in your c:\ root directory.

    Your description of the fields is somewhat vague and includes a duplication (2 fields named period with different lengths).

    Pay no attention to the database name. Just re-using something old.


    Originally posted by andymeer@yahoo.co.uk
    Hi all

    I want to export a file to our accounts package (Sun Accounts) but the file format is very specific it is as follows
    Field Name Field Lenght
    Account No , 15
    period , 7
    invoice date ,10 "yyyymmdd+2
    a field , 15 (always M)
    net value , 18 (no decimal place 28.20 = 2820
    Debit , 2 (always D)
    a field , 5 (always "captn")
    a field , 15 (always "captn")
    invoice No , 15
    invoice , 25 (always word invoice)
    todays date , 8 "yyyymmdd"
    period , 251

    This is then repeated for our vat total

    The report is by ACCOUNT, DEPOT , NOMINAL CODE

    Has any body any idea how i can produce the file


    kind regards

    Andy
    Last edited by Stan Mathews; 03-28-2006, 03:24 PM.
    There can be only one.

    Comment


    • #3
      Hi Stan

      I will attach a sample of my main table where i would get the data from,

      I do not have a sample of the export file as i am at home at the moment but I will get it to you tomorrow

      The file that sun accounts requires does have the duplicate fields, the original program was written in Pick now D3 and i am trying to copy the layout so that it will import into our sun package.

      Stan i have not attached a single part of my dbase before which file extension would you need

      I will try your example and let you know how i get on

      Andy

      Comment


      • #4
        Originally posted by andymeer@yahoo.co.uk
        I will attach a sample of my main table where i would get the data from,
        - That's all I need.

        Originally posted by andymeer@yahoo.co.uk
        I do not have a sample of the export file as i am at home at the moment but I will get it to you tomorrow
        - Don't need that if the specification earlier is correct regarding field types and widths, but it couldn't hurt.

        Originally posted by andymeer@yahoo.co.uk
        The file that sun accounts requires does have the duplicate fields, the original program was written in Pick now D3 and i am trying to copy the layout so that it will import into our sun package.
        - but your table can't have duplicate field names so I couldn't write the export without knowing them.

        Originally posted by andymeer@yahoo.co.uk
        Stan i have not attached a single part of my dbase before which file extension would you need
        - Just the main .dbf.
        There can be only one.

        Comment


        • #5
          Hi Stan

          Please find my cons table attached,

          but your table can't have duplicate field names so I couldn't write the export without knowing them
          The fields Period for 7 I was thinking that i could set this with a var the format is 060 for period 6

          the fields
          captn 5
          captn 15
          m 15
          d 2
          invoice 25

          these are always text so i was thinking that i could write the text "M", "D" etc

          again stan thanks for all your help I was hoping to come to the conference but I am in CA for the 1st to the 20 of june for my wifes sisters wedding but I hope to make it next year and have a chance to meet you

          Andy
          Last edited by andymeer@yahoo.co.uk; 08-13-2006, 04:34 AM.

          Comment


          • #6
            I'm wrong again.

            I seldom use memo fields so I forget them. I can't open your table alone. Please attach all the cons files zipped into one file.

            Just hilight the table in the control panel, right click and choose zip. All the options on the options tab should be checked.


            Originally posted by andymeer@yahoo.co.uk
            Hi Stan

            Please find my cons table attached,



            The fields Period for 7 I was thinking that i could set this with a var the format is 060 for period 6

            the fields
            captn 5
            captn 15
            m 15
            d 2
            invoice 25

            these are always text so i was thinking that i could write the text "M", "D" etc

            again stan thanks for all your help I was hoping to come to the conference but I am in CA for the 1st to the 20 of june for my wifes sisters wedding but I hope to make it next year and have a chance to meet you

            Andy
            There can be only one.

            Comment


            • #7
              Hi Stan

              Tried as you said, it would not zip error said "you cannot send a table that is secured or bound to a dbase please zip whole table"

              The whole table is 160mb

              So i have selected all the cons table files

              Andy
              Last edited by andymeer@yahoo.co.uk; 08-13-2006, 04:34 AM.

              Comment


              • #8
                Originally posted by andymeer@yahoo.co.uk
                Hi Stan

                Tried as you said, it would not zip error said "you cannot send a table that is secured or bound to a dbase please zip whole table"

                The whole table is 160mb

                So i have selected all the cons table files

                Andy
                Ok, now I have the table. Just need to know what fields in the cons table should be exported to what parts of the text file. Like

                Field Name Field Lenght
                Account No , 15 -----------------------------cons.dbf ???? field
                period , 7------------------------------------?????
                invoice date ,10 "yyyymmdd+2----------------etc
                a field , 15 (always M)
                net value , 18 (no decimal place 28.20 = 2820
                Debit , 2 (always D)
                a field , 5 (always "captn")
                a field , 15 (always "captn")
                invoice No , 15
                invoice , 25 (always word invoice)
                todays date , 8 "yyyymmdd"
                period , 251
                There can be only one.

                Comment


                • #9
                  Hi Stan


                  Account = Acno
                  Period = is not in table but I could put it in
                  Invoice date = Invoice_Date
                  M is not in table
                  net value = Net_Total
                  D is not in table
                  captn for 5 is not in table
                  captan for 15 is not in table
                  invoice No = Invoice_No
                  "invoice" is not in table
                  todays date = not in table
                  period = is not in table but I could put it in

                  Could I put the fields into the table which could then be exported ?

                  Andy

                  P.S. it 2300hrs here and i have to be up at 0500, so if there is anything else i will answer in morning

                  Comment


                  • #10
                    On track but...

                    Time for me to go home so we can fill in the details tomorrow.


                    Period = is not in table but I could put it in
                    We can't export data to the text file that doesn't exist. We can fill in things like "invoice" and "captn" but if you want the first "period" section of the text file to be anything other than seven spaces we have to decide where the info will come from. Likewise for the second period section.

                    Sleep well.
                    There can be only one.

                    Comment


                    • #11
                      Morning Stan

                      Our tax year here is from April 1st to March 31st

                      So my periods are as so

                      April 2006001
                      May 2006002
                      June 2006003
                      July 2006004
                      Aug 2006005
                      Sept 2006006
                      Oct 2006007
                      Nov 2006008
                      Dec 2006009
                      Jan 2007010
                      feb 2007011
                      Mar 2007012

                      What i was thinking is that I could put a case statement on a period field in the table, that way the accountant can report by period?

                      Andy
                      Last edited by andymeer@yahoo.co.uk; 01-27-2006, 01:45 AM.

                      Comment


                      • #12
                        That's doable. When you perform the export I suppose the invoice date drives the first period field. What goes in the second where the width is defined as 251?

                        Originally posted by andymeer@yahoo.co.uk
                        Morning Stan

                        Our tax year here is from April 1st to March 31st

                        So my periods are as so

                        April 2006001
                        May 2006002
                        June 2006003
                        July 2006004
                        Aug 2006005
                        Sept 2006006
                        Oct 2006007
                        Nov 2006008
                        Dec 2006009
                        Jan 2007010
                        feb 2007011
                        Mar 2007012

                        What i was thinking is that I could put a case statement on a period field in the table, that way the accountant can report by period?

                        Andy
                        There can be only one.

                        Comment


                        • #13
                          Originally posted by Stan Mathews
                          That's doable. When you perform the export I suppose the invoice date drives the first period field. What goes in the second where the width is defined as 251?
                          We've hit another snag. The fields you mention are not in the cons.dbf. As far as I can tell there are no fields invoice_date, net_total, or invoice_no in any of the tables in what you sent.

                          Can't export what we don't have.
                          There can be only one.

                          Comment


                          • #14
                            Hi Stan

                            I have just zipped the table again and opened it locally and my fields

                            invoice_date
                            invoice_no
                            net_value

                            are all there please try this one

                            Sorry I have not got back sooner but I have been on the road all day

                            Andy
                            Last edited by andymeer@yahoo.co.uk; 08-13-2006, 04:34 AM.

                            Comment


                            • #15
                              I may have had an old copy of your table that wasn't getting over written. The attachment will export everything you specified except the last period field in your specification. I have no clue what you want there. It will put 251 spaces at the end of each line.

                              I couldn't test the first period field completely as there are no values in the invoice_date field and I couldn't make any changes to any records because the posting field rules couldn't find the needed tables.

                              Play with it and we gan go from here.
                              Last edited by Stan Mathews; 03-28-2006, 03:24 PM.
                              There can be only one.

                              Comment

                              Working...
                              X