Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

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

Processing an Excel extract

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

    Processing an Excel extract

    My next challenge using Excel is more complex than I had imagined, so help would be welcome.

    The Excel is downloaded as a WEB file, and needs to be converted to a format which Alpha can work with. I don't have a choice with this input format.
    So far I have been opening the Excel.web and saving it as Excel.xls. All files are the same format.
    There are 15 (possibly a variable number) Excel files to be processed so a quicker way of opening and saving would be good.

    Next, I need to remove the header and trailer which I don't need and I have the logic for that, however I'd like to process all of the files in a folder to remove the records I don't need. Sometimes there will be 15, sometimes 10 and sometimes 20 or so. I can keep a specific folder with just the files I need to be processed in it.

    Then, as the format of the Excel file has 60 columns identified as Field_0 to Field_59, I have mapped to a Final Table with the fields I need to identify the data by, like
    Field_0 = "Project", Field_1 = "Description" etc. So I want to carry out an append operation, lumping all of the Excel files into one and then import into my Final Table. This will need to append while there are any un-appended files in existence.

    So, two things really. Any ideas on opening and saving Excel web to xls and the logic for parsing a folder and a) getting the data updated and b) getting the recursive process of appending.

    I suppose my main problem is cycling through a folder list and processing the files in it.

    All help gratefully received, and I haven't forgotten about the problem with spurious records in a browse. Just running on empty.
    See our Hybrid Option here;
    https://hybridapps.example-software.com/


    Apologies to anyone I haven't managed to upset yet.
    You are held in a queue and I will get to you soon.

    #2
    Re: Processing an Excel extract.

    FILEFIND as C = FILEFIND.GET( File_Pattern as C [, File_Attribute as N [, Format_String as C ]] )


    The FILEFIND.GET() method creates a CR-LF delimited string with information about the files in a directory that match a pattern. The format string controls the format in which the information is returned.

    FOR EACH ... NEXT

    The FOR EACH ... NEXT operators allow you to step through a list, collection, or array without knowing the number of elements that it contains.
    There can be only one.

    Comment


      #3
      Re: Processing an Excel extract

      Ok Stan, got the FileFind processing working well - thank you.
      Just a bit more help if you would. What is the code logic for each item in the list?
      I have set the list up as;
      list_group=filefind.get("c:\test data\*.*",0,"PN|D|T")
      ?list_group
      = c:\test data\.|D|03/02/2015 01:34:04 71 pm
      c:\test data\..|D|03/02/2015 01:34:04 71 pm
      c:\test data\table1.xls|-|03/02/2015 01:33:36 63 pm
      c:\test data\table2.xls|-|03/02/2015 01:34:04 71 pm

      So when I plumb in the For/Next, how do I select the Blue ones?
      See our Hybrid Option here;
      https://hybridapps.example-software.com/


      Apologies to anyone I haven't managed to upset yet.
      You are held in a queue and I will get to you soon.

      Comment


        #4
        Re: Processing an Excel extract

        What logic did you use to select the blue ones? Maybe

        list_group = <<%grp%
        #c:\test data\.|D|03/02/2015 01:34:04 71 pm
        #c:\test data\..|D|03/02/2015 01:34:04 71 pm
        #c:\test data\table1.xls|-|03/02/2015 01:33:36 63 pm
        #c:\test data\table2.xls|-|03/02/2015 01:34:04 71 pm
        #%grp%
        ? list_group
        = c:\test data\.|D|03/02/2015 01:34:04 71 pm
        c:\test data\..|D|03/02/2015 01:34:04 71 pm
        c:\test data\table1.xls|-|03/02/2015 01:33:36 63 pm
        c:\test data\table2.xls|-|03/02/2015 01:34:04 71 pm


        xl_files = ""
        for each line in list_group
        if ".xls" $ line.value
        xl_files = xl_files+line.value+crlf()
        end if
        next

        ? xl_files
        = c:\test data\table1.xls|-|03/02/2015 01:33:36 63 pm
        c:\test data\table2.xls|-|03/02/2015 01:34:04 71 pm

        Or change your filefind to

        list_group=filefind.get("c:\test data\*.xls",0,"PN|D|T",FILE_FIND_NORMAL)
        Last edited by Stan Mathews; 02-04-2015, 12:28 PM.
        There can be only one.

        Comment


          #5
          Re: Processing an Excel extract

          Thanks for the above Stan, but can you point me to the logic for;

          Find the files to be processed (done that with your help)
          For each file
          ...Run an append
          Next file

          I'm OK with For/Next/While loops, just where to put the append logic.
          Should it be the whole append logic or can I call an Operation without converting it to Xbasic?
          I suppose the Xbasic is easily copied into the script so just the right place and do I need FOO as well?
          See our Hybrid Option here;
          https://hybridapps.example-software.com/


          Apologies to anyone I haven't managed to upset yet.
          You are held in a queue and I will get to you soon.

          Comment


            #6
            Re: Processing an Excel extract

            For each file in list_group
            ...Run an append
            Next file

            I don't see how an append operation can use an Excel file as the source/transaction table. Whatever you want to do with the files in list_group goes between for each and next.

            Operations are usually specific in the files they require. IOW, you have to name the source and transaction tables. The advantage to capturing the xbasic and using it is that instead of something like

            import_filename = "c:\temp\npromos.xls"

            you can modify to say

            import_filename = line.value

            where "line" is the placeholder for the list_group variable.

            There's nothing special about foo. When telling Alpha to reference an entry in a list such as list_group you can say

            For each file in list_group
            For each foo in list_group
            For each entry in list_group
            For each of_the_filenames_found in list_group

            Just make sure the ending next file, next foo, whatever - matches.
            There can be only one.

            Comment


              #7
              Re: Processing an Excel extract

              Apologies. In my haste, I omitted that vital step.
              The process should be;
              Identify files
              ..Import to new tables - all same format luckily
              ....Append tables to a master table (that was where I was thinking about launching the Append operation I built as a Proof of Concept.

              I'm working off site next week so I'll be able to concentrate on this and post the results if anyone is following this.
              See our Hybrid Option here;
              https://hybridapps.example-software.com/


              Apologies to anyone I haven't managed to upset yet.
              You are held in a queue and I will get to you soon.

              Comment


                #8
                Re: Processing an Excel extract

                You can capture the import and append operation code, combine it into one script, and place that in the for each....next loop. You could have two separate for each....next loops with the first doing the importing and the second doing the appends.
                There can be only one.

                Comment


                  #9
                  Re: Processing an Excel extract

                  Hi Ted,
                  If you can open the web file in Excel and save it as an xls; after you have removed the headers and such, why not just save the web file in dbf format? Then you can iterate thru those tables in your append script and skip the step of saving to multiple xls and combining them into one xls. You could delete the tables when the append is finished, so your directory has only the files you need for the session.
                  Robin

                  Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

                  Comment


                    #10
                    Re: Processing an Excel extract

                    why not just save the web file in dbf format?
                    That's been deprecated in Excel versions after 2003. May not be an option.

                    I've had to modify a lot of code to save as csv and then import the result. Easier to format the csv as necessary than to rely on whatever Excel supports.
                    There can be only one.

                    Comment


                      #11
                      Re: Processing an Excel extract

                      I'm on 2003 and 2010, so I'll check.
                      I'm sure glad this forum is still up and working.
                      I have to use a product called Jira, and it's awful. The supplier forum is carp also.
                      Not Alpha, a large UK operation I meant.
                      See our Hybrid Option here;
                      https://hybridapps.example-software.com/


                      Apologies to anyone I haven't managed to upset yet.
                      You are held in a queue and I will get to you soon.

                      Comment

                      Working...
                      X