Database Help

Discussion in 'OT Technology' started by aredee, Aug 3, 2005.

  1. aredee

    aredee New Member

    Joined:
    Aug 20, 2002
    Messages:
    1,043
    Likes Received:
    0
    Location:
    Washington DC
    I'm looking for help to break this data into columns:

    example:
    C00000372MAINTENANCE OF WAY POLITICAL LEAGUE A PAC OF THE BMWE GELLER, PERRY K. MR. Sr. 20300 Civic Center Drive Suite 320 SOUTHFIELD MI48076UQUNKMLBROTHERHOOD OF MAINTENANCE OF WAY EMPL


    But i need it to be broken down like:


    character # 1-9 then add a pipe ( | )
    character # 10 + |
    char.. 11-13 + |

    Are you guys getting me?

    - rD
     
  2. kingtoad

    kingtoad OT Supporter

    Joined:
    Sep 2, 2003
    Messages:
    56,157
    Likes Received:
    166
    Location:
    Los Angeles
    No.
     
  3. RaginBajin

    RaginBajin Have you punched a donkey today?

    Joined:
    Dec 24, 2001
    Messages:
    8,740
    Likes Received:
    0
    Location:
    NoVA
    so basically after character 9 to put a | and then every space after that to put a | as well right?
     
  4. aredee

    aredee New Member

    Joined:
    Aug 20, 2002
    Messages:
    1,043
    Likes Received:
    0
    Location:
    Washington DC
    yah you got it

    Im thinking perl might do the trick, but this is going to be one crazy ass script. I got 240 records and im looking for a way to break up the columns with pipes so i can import them into a database.
     
  5. SLED

    SLED custom title

    Joined:
    Sep 20, 2001
    Messages:
    28,123
    Likes Received:
    12
    just import that shit into an access table, then you can export it however you want. Access has awesome support for text file import/exports
     
  6. RaginBajin

    RaginBajin Have you punched a donkey today?

    Joined:
    Dec 24, 2001
    Messages:
    8,740
    Likes Received:
    0
    Location:
    NoVA
    or excel.
     
  7. aredee

    aredee New Member

    Joined:
    Aug 20, 2002
    Messages:
    1,043
    Likes Received:
    0
    Location:
    Washington DC
    Hrm, im sorry i looked at the file wrong. its 24000 records. Excel crashed and access doesnt do by character.
     
  8. SLED

    SLED custom title

    Joined:
    Sep 20, 2001
    Messages:
    28,123
    Likes Received:
    12
    sure it does. make sure you select a "fixed width" format
     
  9. Keyzs

    Keyzs OT Supporter

    Joined:
    Nov 3, 2003
    Messages:
    814
    Likes Received:
    0
    Location:
    Charlotte, MI
    Take that line your showing and change it to what you want it to look like when finished.
     
  10. SLED

    SLED custom title

    Joined:
    Sep 20, 2001
    Messages:
    28,123
    Likes Received:
    12
    i guess you could always use sed if you're a *NIX guy.
     

Share This Page