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

Convert labels file back to a table

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

    Convert labels file back to a table

    Hi everyone �

    I�ve searched and searched and can�t find any similar threads so hopefully someone can either help me out or point me in the right direction.

    I have had 3 different clients of that want me to convert their data to �something more usable�.

    I�m thinking (and actually said) �no problem� � until I got into actually trying to get the job done. I need to convert each label in to a record and then parse the information in to fields

    The common denominator here between all 3 clients is that all of their mailing lists are in a �labels� type format. Two are in MS Word and the other is MS Works. They actually just typed the address labels directly into the label. They are all in 3 across and 10 down � Avery 5160 format.
    Most of the addresses are three lines but all the files have labels with up to 6 lines in the labels �mixed in�.

    I�ve tried saving as plain text, trying to cut and paste to a spread sheet, and a bunch of other things and just can�t get it right.

    I would really appreciate any ideas anyone might be able to pass my way.
    There is about 12,000 labels total between all of the files from the best that I can tell and I could really use some help saving face.

    Thanks!

    Scott

    #2
    Re: Convert labels file back to a table

    Sounds like a job for some xbasic character string manipulation routines.

    Probably not too pretty, but could be done..
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.
    "Make it as simple as possible, but not simpler."
    Albert Einstein

    http://www.iadn.com/images/media/iadn_member.png

    Comment


      #3
      Re: Convert labels file back to a table

      Post a representative sample of the data for us to experiment?
      There can be only one.

      Comment


        #4
        Re: Convert labels file back to a table

        Originally posted by Stan Mathews View Post
        Post a representative sample of the data for us to experiment?
        Hi Stan -

        You beat me to it. I was actually experimenting here to figure out how to do that.

        Attached is a Word doc like I have. If the names look familar they are -
        I mereged the data from Alpha Sports to create labels like those in the files I have. The disadvantage I have in the real labels I have as I mentioned is that they typed the data directly into the labels.

        Hope this helps - Thanks for looking.

        Scott

        Later: I should mention that the issue is more getting each label out as a record as much as anything. I don't have a problem with parsing out each line into fields.
        Last edited by Scott Axton; 07-30-2009, 09:21 AM. Reason: more info

        Comment


          #5
          Re: Convert labels file back to a table

          Assuming you can create a word document from the client data like you did this.....

          Open the merged document in word.
          Select all and copy.
          Open excel blank workbook.
          Paste
          Size columns as needed.
          Add field titles.

          You can then save as a dbf and parse the records there to another table or ole to the excel file and create records in another table from the file.
          There can be only one.

          Comment


            #6
            Re: Convert labels file back to a table

            Is the data on paper? or in a file?
            Cole Custom Programming - Terrell, Texas
            972 524 8714
            [email protected]

            ____________________
            "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

            Comment


              #7
              Re: Convert labels file back to a table

              Originally posted by Stan Mathews View Post
              Assuming you can create a word document from the client data like you did this.....

              Open the merged document in word.
              Select all and copy.
              Open excel blank workbook.
              Paste
              Size columns as needed.
              Add field titles.

              You can then save as a dbf and parse the records there to another table or ole to the excel file and create records in another table from the file.
              Stan -

              I tried this before I posted this topic. The problem is determining where the records break due to the number of lines per label not being consistant. It is one thing to look at three pages of records to compare back and forth. It is a whole different thing when I'm looking at doing 400 pages worth of labels.

              When you do it this way, as you can see in the example each line of the label is split in to a new cell going down. Even if I save it off as a .dbf how would you determine where the records start and stop (programatically)?


              Is the data on paper? or in a file?
              Martin -

              I have the actual data files. Each file is just in a "table" like shown in the example I posted.

              Comment


                #8
                Re: Convert labels file back to a table

                Empty records delimit records to be parsed.

                I started on a script that still has minor issues, just working through the first field (some records were duplicated)>

                Code:
                dim org_tbl as P
                dim rsl_tbl as P
                rsl_tbl = table.open("reslt")
                org_tbl = table.open("parse")
                org_tbl.index_primary_put()
                org_tbl.fetch_first()
                strt_rec = org_tbl.recno()
                while .not. org_tbl.fetch_eof()
                	line_ctr = 1
                	while (.not. (alltrim(alltext_initial("parse")) = "")) .and. (.not. org_tbl.fetch_eof())
                		select
                		   case line_ctr = 1
                		   to_rslt1 = org_tbl.Field1
                	   		stop_rec = org_tbl.recno()
                	   		case line_ctr = 2
                	   		to_rslt2 = org_tbl.Field1
                	   		stop_rec = org_tbl.recno()
                	   		case line_ctr = 3
                	   		to_rslt3 = org_tbl.Field1
                	   		stop_rec = org_tbl.recno()
                	   		case line_ctr = 4
                	   		to_rslt4 = org_tbl.Field1
                	   		stop_rec = org_tbl.recno()
                	   		case line_ctr = 5
                	   		to_rslt5 = org_tbl.Field1
                	   		stop_rec = org_tbl.recno()
                	   		case line_ctr = 6
                	   		to_rslt6 = org_tbl.Field1
                	   		stop_rec = org_tbl.recno()
                	   	end select
                	  org_tbl.fetch_next()
                	  line_ctr = line_ctr + 1
                	end while
                		rsl_tbl.enter_begin()
                		if eval_valid("to_rslt1")
                		rsl_tbl.Rslt1 = to_rslt1
                		end if
                		if eval_valid("to_rslt2")
                		rsl_tbl.Rslt2 = to_rslt2
                		end if
                		if eval_valid("to_rslt3")
                		rsl_tbl.Rslt3 = to_rslt3
                		end if
                		if eval_valid("to_rslt4")
                		rsl_tbl.Rslt4 = to_rslt4
                		end if
                		if eval_valid("to_rslt5")
                		rsl_tbl.Rslt5 = to_rslt5
                		end if
                		if eval_valid("to_rslt6")
                		rsl_tbl.Rslt6 = to_rslt6
                		end if
                		rsl_tbl.enter_end(.T.)
                		org_tbl.fetch_next()
                end while
                
                rsl_tbl.close()
                org_tbl.close()
                I'll keep working on it as I have time. You might use it as a starting point.
                There can be only one.

                Comment


                  #9
                  Re: Convert labels file back to a table

                  Since he has the actual files, would it help any if he loaded them into MS Word and moved coulmns 2 & 3 so that instead of a 3x10 page they were all in a single column?

                  Eric

                  Comment


                    #10
                    Re: Convert labels file back to a table

                    Or move them in excel but that would be too easy.

                    Improved script process all three fields. No duplicates but does create some blank records. Still under development. (assumes max 6 lines per label)

                    Code:
                    dim org_tbl as P
                    dim rsl_tbl as P
                    dim to_rslt1 as C
                    dim to_rslt2 as C
                    dim to_rslt3 as C
                    dim to_rslt4 as C
                    dim to_rslt5 as C
                    dim to_rslt6 as C
                    rsl_tbl = table.open("reslt",FILE_RW_EXCLUSIVE)
                    org_tbl = table.open("parse",FILE_RW_EXCLUSIVE)
                    org_tbl.index_primary_put()
                    'process field1
                    org_tbl.fetch_first()
                    WHILE .not. org_tbl.fetch_eof()
                    	line_ctr = 1
                    	WHILE (.not. (alltrim(alltext_initial("parse")) = "")) .and. (.not. org_tbl.fetch_eof())
                    		SELECT
                    			CASE line_ctr = 1
                    				to_rslt1 = org_tbl.Field1
                    				
                    			CASE line_ctr = 2
                    				to_rslt2 = org_tbl.Field1
                    				
                    			CASE line_ctr = 3
                    				to_rslt3 = org_tbl.Field1
                    				
                    			CASE line_ctr = 4
                    				to_rslt4 = org_tbl.Field1
                    				
                    			CASE line_ctr = 5
                    				to_rslt5 = org_tbl.Field1
                    				
                    			CASE line_ctr = 6
                    				to_rslt6 = org_tbl.Field1
                    				
                    		END SELECT
                    		org_tbl.fetch_next()
                    		line_ctr = line_ctr + 1
                    	END WHILE
                    	rsl_tbl.enter_begin()
                    	rsl_tbl.Rslt1 = to_rslt1
                    	rsl_tbl.Rslt2 = to_rslt2
                    	rsl_tbl.Rslt3 = to_rslt3
                    	rsl_tbl.Rslt4 = to_rslt4
                    	rsl_tbl.Rslt5 = to_rslt5
                    	rsl_tbl.Rslt6 = to_rslt6
                    	rsl_tbl.enter_end(.T.)
                    	WHILE (alltrim(alltext_initial("parse")) = "") .and. (.not. org_tbl.fetch_eof())
                    		org_tbl.fetch_next()
                    	END WHILE
                    	to_rslt1 = ""
                    	to_rslt2 = ""
                    	to_rslt3 = ""
                    	to_rslt4 = ""
                    	to_rslt5 = ""
                    	to_rslt6 = ""
                    END WHILE
                    'process field2
                    org_tbl.fetch_first()
                    WHILE .not. org_tbl.fetch_eof()
                    	line_ctr = 1
                    	WHILE (.not. (alltrim(alltext_initial("parse")) = "")) .and. (.not. org_tbl.fetch_eof())
                    		SELECT
                    			CASE line_ctr = 1
                    				to_rslt1 = org_tbl.Field2
                    				
                    			CASE line_ctr = 2
                    				to_rslt2 = org_tbl.Field2
                    				
                    			CASE line_ctr = 3
                    				to_rslt3 = org_tbl.Field2
                    				
                    			CASE line_ctr = 4
                    				to_rslt4 = org_tbl.Field2
                    				
                    			CASE line_ctr = 5
                    				to_rslt5 = org_tbl.Field2
                    				
                    			CASE line_ctr = 6
                    				to_rslt6 = org_tbl.Field2
                    				
                    		END SELECT
                    		org_tbl.fetch_next()
                    		line_ctr = line_ctr + 1
                    	END WHILE
                    	rsl_tbl.enter_begin()
                    	rsl_tbl.Rslt1 = to_rslt1
                    	rsl_tbl.Rslt2 = to_rslt2
                    	rsl_tbl.Rslt3 = to_rslt3
                    	rsl_tbl.Rslt4 = to_rslt4
                    	rsl_tbl.Rslt5 = to_rslt5
                    	rsl_tbl.Rslt6 = to_rslt6
                    	rsl_tbl.enter_end(.T.)
                    	WHILE (alltrim(alltext_initial("parse")) = "") .and. (.not. org_tbl.fetch_eof())
                    		org_tbl.fetch_next()
                    	END WHILE
                    	to_rslt1 = ""
                    	to_rslt2 = ""
                    	to_rslt3 = ""
                    	to_rslt4 = ""
                    	to_rslt5 = ""
                    	to_rslt6 = ""
                    END WHILE
                    'process field3
                    org_tbl.fetch_first()
                    
                    WHILE .not. org_tbl.fetch_eof()
                    	line_ctr = 1
                    	WHILE (.not. (alltrim(alltext_initial("parse")) = "")) .and. (.not. org_tbl.fetch_eof())
                    		SELECT
                    			CASE line_ctr = 1
                    				to_rslt1 = org_tbl.Field3
                    				
                    			CASE line_ctr = 2
                    				to_rslt2 = org_tbl.Field3
                    				
                    			CASE line_ctr = 3
                    				to_rslt3 = org_tbl.Field3
                    				
                    			CASE line_ctr = 4
                    				to_rslt4 = org_tbl.Field3
                    				
                    			CASE line_ctr = 5
                    				to_rslt5 = org_tbl.Field3
                    				
                    			CASE line_ctr = 6
                    				to_rslt6 = org_tbl.Field3
                    				
                    		END SELECT
                    		org_tbl.fetch_next()
                    		line_ctr = line_ctr + 1
                    	END WHILE
                    	rsl_tbl.enter_begin()
                    	rsl_tbl.Rslt1 = to_rslt1
                    	rsl_tbl.Rslt2 = to_rslt2
                    	rsl_tbl.Rslt3 = to_rslt3
                    	rsl_tbl.Rslt4 = to_rslt4
                    	rsl_tbl.Rslt5 = to_rslt5
                    	rsl_tbl.Rslt6 = to_rslt6
                    	rsl_tbl.enter_end(.T.)
                    	WHILE (alltrim(alltext_initial("parse")) = "") .and. (.not. org_tbl.fetch_eof())
                    		org_tbl.fetch_next()
                    	END WHILE
                    	to_rslt1 = ""
                    	to_rslt2 = ""
                    	to_rslt3 = ""
                    	to_rslt4 = ""
                    	to_rslt5 = ""
                    	to_rslt6 = ""
                    END WHILE
                    
                    rsl_tbl.close()
                    org_tbl.close()
                    The blank records are the two "unbalanced" blank entries in the final row of the original file. Not worth working out how to not create those. They can be filtered out of the result table.
                    Last edited by Stan Mathews; 07-30-2009, 12:29 PM.
                    There can be only one.

                    Comment


                      #11
                      Re: Convert labels file back to a table

                      Originally posted by Stan Mathews View Post
                      Or move them in excel but that would be too easy.
                      Now why didn't I think of that?

                      Improved script process all three fields. No duplicates but does create some blank records. Still under development. (assumes max 6 lines per label)

                      Goodness! I didn't expect you to do it for me! I'll look at this closer in a bit. Work has me burried at the moment. I'd rather play with this but unfortunately I have grown accustomed to eating so I guess I have to play that game first.

                      Back soon -

                      Scott

                      Comment


                        #12
                        Re: Convert labels file back to a table

                        Sorry for having some remarks.

                        Because of the privacy of your clienst names and addresses - I guess - you have taken an Alpha clienttable.
                        Making lables from a table results in a regular labelformat.
                        I doubt or this is the reality for the labels you have to convert, as you wrote that it is just typed into labels.
                        So without any check of format before.

                        I have some experience with this matter and I know how supprising the irregularities appear.
                        It's a big job that must be done step by step with trial and error before you have formatted all the data to the right fields.
                        The 80-20 rule is apply to this.
                        80% of the data takes 20% of your time and 20% of the data takes 80% of the time.
                        The most complicated adresses must be changed by hand.

                        I admire Stan's effort and I will follow this threat with much interest.
                        Good luck

                        Ton
                        Most things are simple but unfortunately only after the first time

                        Comment

                        Working...
                        X