Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Post How to split the content of one column into 4 columns?


    How to split the content of one column into 4 columns?
    Please, see the attached image that shows my question
    Attached also the table
    i need to split the column that contains the N E values into 4 columns
    Why I need this?
    I’m given the coordinates in long-lat and I need to convert them into XY, so first I need to convert them into Decimal degrees then to be converted to xy.
    Thank you

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Look up the Left() Mid() and Right() functions. You can use them in a query to get it done.

  3. #3
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by TheShabz View Post
    Look up the Left() Mid() and Right() functions. You can use them in a query to get it done.
    even easier than this, would be to use the split() function. it would be much easier to write, as it would simply be a loop through the result array and assignment to each field.

    it does depend on how large the set is though. the larger, the slow the function call would be. It would work easier simply because it appears that your data is always parsed by the space. is that true?

  4. #4
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    How to split the content of one column into 4 columns?

    Thank you for the answer
    Please, see the attached image
    I don’t feel that I can do it! Well, what I’m looking for now is only how to get rid of the two letters (E and N.) from the column named position
    Appreciated
    Jamal


    Quote Originally Posted by TheShabz View Post
    Look up the Left() Mid() and Right() functions. You can use them in a query to get it done.

  5. #5
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    If all you want to do is Remove the "E" and the "N", there is a handy tool called the Find/Replace.
    1. backup your table
    2. ctrl+H
    3. choose the proper field in "Look In"
    4. enter in E in "Find What"
    5. enter in "" in "Replace With"
    6. change "Match" to "Any part of field"
    7. repeat 1-6 with N instead of E

  6. #6
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by TheShabz View Post
    If all you want to do is Remove the "E" and the "N", there is a handy tool called the Find/Replace.
    1. backup your table
    2. ctrl+H
    3. choose the proper field in "Look In"
    4. enter in E in "Find What"
    5. enter in "" in "Replace With"
    6. change "Match" to "Any part of field"
    7. repeat 1-6 with N instead of E
    yep! do this. the request is simpler than I thought

  7. #7
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    a simpler way is(may need some knowledge of pattern to understand):
    1. backup your table
    2. ctrl+H
    3. choose the proper field in "Look In"
    4. enter in "[EN]" in "Find What"
    5. enter in "" in "Replace With"
    6. change "Match" to "Any part of field"
    7. click "Replace All"

  8. #8
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    [EN] is interpreted as E OR N?

  9. #9
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    How to split the content of one column into 4 columns?

    thank you for the answer.

    i did the steps but it didn't work! what might be the problem!

    please, see the attached image that shows how i did it!!!!!

    i'm attaching also the access file itself...

    thank you


    Quote Originally Posted by ajetrumpet View Post
    yep! do this. the request is simpler than I thought

  10. #10
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    did you hit "replace all"?

  11. #11
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    How to split the content of one column into 4 columns?

    thank you! i kept pressing next instead of replace!

    but it replaces the N by the "", while i need to reomove the N but not replace it by "" or by even a spcae!!!

    please, see that attached image about the result!


    how can i do that?

    appreciated

    Jamal



    Quote Originally Posted by TheShabz View Post
    did you hit "replace all"?

  12. #12
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    My mistake. "" is usually the indicator for empty string. Just leave the "replace with" blank. That should do it. Also, you'll have to manually delete the few that you already replaced, but that shouldn't be an issue.

    Hit "replace all" instead of "replace". It'll save you some time.

  13. #13
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113

    Thumbs up

    thank you so much. your notes are very helpful. it did work



    Quote Originally Posted by TheShabz View Post
    My mistake. "" is usually the indicator for empty string. Just leave the "replace with" blank. That should do it. Also, you'll have to manually delete the few that you already replaced, but that shouldn't be an issue.

    Hit "replace all" instead of "replace". It'll save you some time.

  14. #14
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Glad you got it working. If it's all working well, go ahead and mark the thread as solved so others can make use of it as well.

    Thanks

  15. #15
    jamal numan is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jan 2011
    Location
    Ramallah, West Bank
    Posts
    113
    Yes sure.

    but:

    - how to mark it as solved? i couldn't find the botton! could u please indictae me how?

    - the title of the thread was to separat the columns into four! but what we did is just to remove the E and N

    thank u





    Quote Originally Posted by TheShabz View Post
    Glad you got it working. If it's all working well, go ahead and mark the thread as solved so others can make use of it as well.

    Thanks

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Hiding columns in split form.
    By cementblocks in forum Forms
    Replies: 5
    Last Post: 03-11-2014, 07:16 AM
  2. Replies: 1
    Last Post: 12-01-2010, 11:01 AM
  3. Replies: 2
    Last Post: 07-26-2010, 11:28 AM
  4. Split string into Date and Time Columns?
    By Hobbes29 in forum Queries
    Replies: 2
    Last Post: 06-08-2010, 06:50 PM
  5. split a column into two seperate columns
    By nybanshee in forum Access
    Replies: 2
    Last Post: 08-14-2008, 04:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums