If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > How 2 textedit DXF proxy graphic file, with vi, awk or sed ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-28-03, 07:46
ketchup ketchup is offline
Registered User
 
Join Date: Nov 2003
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 12-10-03, 13:37
ika ika is offline
Registered User
 
Join Date: Oct 2003
Location: Slovakia
Posts: 482
Re: How 2 textedit DXF proxy graphic file, with vi, awk or sed ?

Quote:
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On