Get data in a specific format

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

gandalf
Posts: 11
Joined: Mon Apr 16, 2012 12:25 pm

Get data in a specific format

Postby gandalf » Thu Apr 17, 2014 3:12 am

    Dear all,

    I have some data in the following format in a text file.

    LINE_NAME="one", MODE=10, OWNER="10", ONEWAY=T, FREQ1=20,
    FREQ2=20, LONGNAME="Route 1 Florida Ave (Dwntn to UATC)",
    N=20001, -6105, -6124, 6144, -6158, -9049, 6198, 6249, 6295,
    6316, 6350, 6404, 6472, 6550, 6591, 6636, -6640, 6718, 6769,
    6810, 6876, 6906, -6918, 6939, 6963, 7006, 7094, 9041, -7145,
    9039, 7217, 7247, 9037, 7311, 9034, 7357, -7380, 7393, -7407,
    -7423, 7444, 9030, -7491, 9032, -7491, 7514, 7540, 7577, 7602,
    7635, 7672, 7714, 7755, 7797, 7836, 7867, 7929, -7940, -7945,
    7950, 7956, 8008, 8062, 8074, 8093, 8096, 8100, 8110, 8088,
    8057, 8009, 7996, 7977, 7988, -7995, 20002
    LINE_NAME="two", MODE=5, OWNER="5", ONEWAY=T, FREQ1=30,
    FREQ2=60, LONGNAME="Route 1 Florida Ave (UATC to Dwtn)",
    N=20002, -7995, 7988, 7977, 7996, -8009, 8057, 8088, 8110,
    8100, 8096, 8093, 8074, 8062, 8008, 7956, 7950, -7945, -7940,
    7929, 7867, 7836, 7797, 7755, 7714, 7672, 7635, 7602, 7577,
    7540, 7514, 7491, 9032, -7491, 9030, 7444, 7423, 7407, 7393,
    -7380, 7357, 9034, 7311, 9037, 7247, 7217, 9039, -7145, 9041,
    7094, 7006, 6963, 6939, -6918, -6913, 6897, 6862, 6794, 6749,
    6703, -6686, 6620, 6575, 6534, 6462, 6383, 6344, 6302, 6286,
    6239, 6191, 6141, -6125, -9021, -6137, 6144, -6124, -6105,
    20001


    I want this data to be in the following format

    Code: Select all

    Line_Name   Mode     Owner  Oneway         FREQ1      FREQ2             LONGNAME                            N
    one           10      10       T            20        20         Route 1 Florida Ave (Dwntn to UATC)      20001
    one           10      10       T            20        20         Route 1 Florida Ave (Dwntn to UATC)      -6105
    one           10      10       T            20        20         Route 1 Florida Ave (Dwntn to UATC)      -6124
    one           10      10       T            20        20         Route 1 Florida Ave (Dwntn to UATC)      -6144
    one           10      10       T            20        20         Route 1 Florida Ave (Dwntn to UATC)      -6158
    one           10      10       T            20        20         Route 1 Florida Ave (Dwntn to UATC)      -9049
    ........................................................................................................................................
    ........................................................................................................................................
    ........................................................................................................................................
    one           10      10        T            20        20         Route 1 Florida Ave (Dwntn to UATC)      20002
    two           5        5        T            30        60         Route 1 Florida Ave (UATC to Dwtn)        20002
    two           5        5        T            30        60         Route 1 Florida Ave (UATC to Dwtn)        -7995
    two           5        5        T            30        60         Route 1 Florida Ave (UATC to Dwtn)         7988
    two           5        5        T            30        60         Route 1 Florida Ave (UATC to Dwtn)         7977
    two           5        5        T            30        60         Route 1 Florida Ave (UATC to Dwtn)         7996
    ........................................................................................................................................
    ........................................................................................................................................
    ........................................................................................................................................
    two           5        5        T            30        60         Route 1 Florida Ave (UATC to Dwtn)         -6105
    two           5        5        T            30        60         Route 1 Florida Ave (UATC to Dwtn)         20001
    

    Is this possible through spss? Any suggestions will be helpful

    Who is online

    Users browsing this forum: No registered users and 1 guest

    cron