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

Import Spreadsheet

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

    Import Spreadsheet

    Hello

    A current customer has their data stored in Excel spread sheets.

    Essentially a spread sheet consists of columns such as

    Month
    Building
    Task

    The first two are OK.

    The task column however, consists of cells where there are more than one task separated by a number.
    Please see attached.

    Tasks.jpg

    What I would like to do is separate the tasks into different rows for the building.

    Can anyone suggest a way I can do this please?

    Thanks for your help. It is very much appreciated.

    Kind regards

    Alex
    Database Software Solutions Limited
    www.dbasesolution.co.uk
    http://www.precise360.co.uk
    PRECISE360 -
    LYNCHPIN -

    #2
    Re: Import Spreadsheet

    Any knowledge of the maximum number of characters in the task column presently? IOW, can you import as is into a character field and process the sontents into separate fields?
    There can be only one.

    Comment


      #3
      Re: Import Spreadsheet

      Originally posted by Stan Mathews View Post
      Any knowledge of the maximum number of characters in the task column presently? IOW, can you import as is into a character field and process the sontents into separate fields?
      Hi Stan

      Thanks for your fast response.

      The most characters including spaces in any one cell is 791.

      This varies all the way down to 7

      There are 1808 rows in the spreads sheet.

      Kind Regards

      Alex
      Database Software Solutions Limited
      www.dbasesolution.co.uk
      http://www.precise360.co.uk
      PRECISE360 -
      LYNCHPIN -

      Comment


        #4
        Re: Import Spreadsheet

        The most characters including spaces in any one cell is 791.
        Too big for a character field.

        Can you attach a sample spreadsheet with a few records on which to experiment?
        There can be only one.

        Comment


          #5
          Re: Import Spreadsheet

          Hi Alex,

          Is it not possible to chop up the text in the spreadsheet before the import?
          Regards
          Keith Hubert
          Alpha Guild Member
          London.
          KHDB Management Systems
          Skype = keith.hubert


          For your day-to-day Needs, you Need an Alpha Database!

          Comment


            #6
            Re: Import Spreadsheet

            Originally posted by Stan Mathews View Post
            Too big for a character field.

            Can you attach a sample spreadsheet with a few records on which to experiment?
            Hi Stan

            having great difficulty attached sample spread sheet.

            Can you send me your email me on [email protected] and I will send it that way.

            Many Thanks

            Alex
            Database Software Solutions Limited
            www.dbasesolution.co.uk
            http://www.precise360.co.uk
            PRECISE360 -
            LYNCHPIN -

            Comment


              #7
              Re: Import Spreadsheet

              Hi Keith

              I would love to chop up the text in the spread sheet, but alas I don't know how.


              Kind Regards

              Alex
              Database Software Solutions Limited
              www.dbasesolution.co.uk
              http://www.precise360.co.uk
              PRECISE360 -
              LYNCHPIN -

              Comment


                #8
                Re: Import Spreadsheet

                Meanwhile.

                Save one of the spreadsheets as .csv.

                Open in your favorite text editor.

                Do a search and replace for

                2.
                read(space2.space)
                replace with , (read (comma))

                Repeat for all other possible designators (3., 4., etc)

                Import the resulting csv file.

                That process can be automated if there are many client spreadsheets.
                There can be only one.

                Comment


                  #9
                  Re: Import Spreadsheet

                  Previous suggestion does not work due to crlf() characters in address field. Still looking.
                  There can be only one.

                  Comment


                    #10
                    Re: Import Spreadsheet

                    Is there some way you could import it into a temporary table, then parse the field looking for "1.", "2.", etc? Once you found the 2,3,4,etc, count the characters and do substr(field) for each specific length, then take that data and place it into separate fields. I know it is a lot of work, but I think it can be done.

                    Tom

                    Comment


                      #11
                      Re: Import Spreadsheet

                      "Too big for a character field."

                      Can the text be imported into a memo field?
                      Regards
                      Keith Hubert
                      Alpha Guild Member
                      London.
                      KHDB Management Systems
                      Skype = keith.hubert


                      For your day-to-day Needs, you Need an Alpha Database!

                      Comment


                        #12
                        Re: Import Spreadsheet

                        Originally posted by alexmuir View Post
                        What I would like to do is separate the tasks into different rows for the building.
                        You could do this easily, either by breaking the Task column in Excel then import into alpha, or better break it in alpha.
                        The above part of your question is not quite clear. I would guess what you want to do, or should do depending on the number of these tasks, is create a set where the imported table from Excel will be the parent and then create another table, call it tasks, and link it in 1:M as a child using the building (Or building ID) as the linking field.

                        I could give you a mock script on how to do all of that, or if you show (or better attach a zip file) what the actual columns in Excel are, that would make things much more comprehensible.

                        Comment


                          #13
                          Re: Import Spreadsheet

                          You need the Memo field like Keith suggested.
                          You will never be able to report on the existing data if it is over the Char filed size limit.
                          The structure probably needs to be a Set with;
                          Month
                          1:M Building
                          1:M Task where (Task is the memo content)
                          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


                            #14
                            Re: Import Spreadsheet

                            Thanks everyone for the positive input in trying solve my spreadsheet issue.

                            Stan with great dogged determination came up with a solution that has worked fine.

                            Attached is his working example.

                            The instructions are:

                            Uncompress and add this table to a database where you don�t have a table named sample. Structure is

                            Name Character 40 0
                            AddressCharacter 40 0
                            Muni Character 40 0
                            Code Character 10 0
                            Task1 Character 150 0
                            Task2 Character 150 0
                            Task3 Character 150 0
                            Task4 Character 150 0
                            Task5 Character 150 0
                            Task6 Character 150 0

                            Open your spreadsheet like you sent me and save as Text (tab delimited)

                            Adjust paths as necessary and use this script.

                            tbl = table.open("sample")
                            tbl.zap(.T.)
                            fil = file.open("P:\Sample3.txt",FILE_RW_EXCLUSIVE)
                            while .not. fil.eof()
                            ln = fil.read_line()
                            tbl.enter_begin()
                            tbl.name = word(ln,1,chr(9))
                            tbl.address = word(ln,2,chr(9))
                            tbl.muni = word(ln,3,chr(9))
                            tbl.code = word(ln,4,chr(9))
                            to_parse = word(ln,5,chr(9))
                            if at("1.",to_parse) > 0
                            st = at("1.",to_parse) + 2
                            if at("2.",to_parse) > 0
                            nd = at("2.",to_parse) - 3
                            lth = nd-st+1
                            tbl.task1 = substr(to_parse,st,lth)
                            else
                            tbl.task1 = substr(to_parse,st)
                            end if
                            if at("3.",to_parse) > 0
                            st = at("2.",to_parse) + 2
                            nd = at("3.",to_parse) - 3
                            lth = nd-st+1
                            tbl.task2 = substr(to_parse,st,lth)
                            else
                            if at("2.",to_parse) > 0
                            st = at("2.",to_parse) + 2
                            tbl.task2 = substr(to_parse,st)
                            end if
                            end if
                            if at("4.",to_parse) > 0
                            st = at("3.",to_parse) + 2
                            nd = at("4.",to_parse) - 3
                            lth = nd-st+1
                            tbl.task3 = substr(to_parse,st,lth)
                            else
                            if at("3.",to_parse)> 0
                            st = at("3.",to_parse) + 2
                            tbl.task3 = substr(to_parse,st)
                            end if
                            end if
                            if at("5.",to_parse) > 0
                            st = at("4.",to_parse) + 2
                            nd = at("5.",to_parse) - 3
                            lth = nd-st+1
                            tbl.task4 = substr(to_parse,st,lth)
                            else
                            if at("4.",to_parse)> 0
                            st = at("4.",to_parse) + 2
                            tbl.task4 = substr(to_parse,st)
                            end if
                            end if
                            if at("6.",to_parse) > 0
                            st = at("5.",to_parse) + 2
                            nd = at("6.",to_parse) - 3
                            lth = nd-st+1
                            tbl.task5 = substr(to_parse,st,lth)
                            tbl.task6 = substr(to_parse,nd+6)
                            else
                            if at("5.",to_parse)> 0
                            st = at("5.",to_parse) + 3
                            tbl.task5 = substr(to_parse,st)
                            end if
                            end if
                            else
                            tbl.task1 = to_parse
                            end if
                            tbl.enter_end(.T.)
                            end while
                            fil.close()
                            tbl.close()

                            I also attach my sample spreadsheet which Stan used.

                            Once again thanks for everyone who took the time to help me.
                            This and Stan's input are reminders of the great Alpha spirit

                            Kind Regards

                            Alex



                            sample.zip Sample3.rar
                            Database Software Solutions Limited
                            www.dbasesolution.co.uk
                            http://www.precise360.co.uk
                            PRECISE360 -
                            LYNCHPIN -

                            Comment

                            Working...
                            X