Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003
    Posts
    1

    Unanswered: How 2 textedit DXF proxy graphic file, with vi, awk or sed ?

    Hi!

    Problem summary:

    Many lines in text files with something like
    {\W0.960784;Numbers or text to keep}

    After fix it should be:
    Numbers or text to keep

    The looong story:
    I have some DXF files that contain lines with to much information. There is a problem with proxy graphics which gives strange print outs in the drawing if the editor doesn't support proxy graphics. The print out lines in the DXF code has the correct string in between incorrect characters. To fix this I would like to delete these characters.

    The pattern for these lines is a ";". Before this ";" there is characters to delete with pattern "{W1.XXXXXX where the X is different numbers. After the ";" is the correct text followed by a "}". Since I have about 50 files with 30000 lines and 200 incorrect lines to operate it would be great to fix this with a script. Unfortunately I am novice in the world of UNIX. Is there someone with a simple solution that will make a "dxf_file" to a correct file "dxf_file_fix" ???

    I have tried in vi (SGI) with the commands "/;", "11X", "x", "/}", "x" witch make ONE correct line, but how to loop it?

    I would really appreciate help in this case!

    /Ketchup




    Example of a part from a DXF_file:

    00^M
    AcDbMText^M
    10^M
    -580.1154021852235^M
    20^M
    5121.36329191389^M
    30^M
    0.0^M
    40^M
    10.0^M
    41^M
    0.0^M
    71^M
    2^M
    72^M
    1^M
    1^M
    {\W1.123456;ABC}^M
    73^M
    1^M
    44^M
    1.0^M
    0^M
    INSERT^M
    5^M
    7F6^M
    330^M

    {\W1.416298;1111}^M
    7F4^M
    100^M
    AcDbEntity^M

    {\W1.416298;BBB}^M
    8^M
    ____1^M
    6^M
    Continuous^M
    62^M
    1^M
    370^M
    25^M

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: How 2 textedit DXF proxy graphic file, with vi, awk or sed ?

    Originally posted by ketchup
    Hi!

    Problem summary:

    Many lines in text files with something like
    {\W0.960784;Numbers or text to keep}

    After fix it should be:
    Numbers or text to keep

    The looong story:
    I have some DXF files that contain lines with to much information. There is a problem with proxy graphics which gives strange print outs in the drawing if the editor doesn't support proxy graphics. The print out lines in the DXF code has the correct string in between incorrect characters. To fix this I would like to delete these characters.

    The pattern for these lines is a ";". Before this ";" there is characters to delete with pattern "{W1.XXXXXX where the X is different numbers. After the ";" is the correct text followed by a "}". Since I have about 50 files with 30000 lines and 200 incorrect lines to operate it would be great to fix this with a script. Unfortunately I am novice in the world of UNIX. Is there someone with a simple solution that will make a "dxf_file" to a correct file "dxf_file_fix" ???

    I have tried in vi (SGI) with the commands "/;", "11X", "x", "/}", "x" witch make ONE correct line, but how to loop it?

    I would really appreciate help in this case!

    /Ketchup




    Example of a part from a DXF_file:

    00^M
    AcDbMText^M
    10^M
    -580.1154021852235^M
    20^M
    5121.36329191389^M
    30^M
    0.0^M
    40^M
    10.0^M
    41^M
    0.0^M
    71^M
    2^M
    72^M
    1^M
    1^M
    {\W1.123456;ABC}^M
    73^M
    1^M
    44^M
    1.0^M
    0^M
    INSERT^M
    5^M
    7F6^M
    330^M

    {\W1.416298;1111}^M
    7F4^M
    100^M
    AcDbEntity^M

    {\W1.416298;BBB}^M
    8^M
    ____1^M
    6^M
    Continuous^M
    62^M
    1^M
    370^M
    25^M
    In vi try add "g" after last slash for example:

    :%s/text_to_be_replaced/replace_by_phrase/g

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •