3

I'm trying to make a quick code to give me coordinates of some circles to be read in AUTOCAD.

When I use the format "Table" or "String" to Export it always gives me something like

{circle, 5.5, 57.5}
{circle, 5.5, 109.5}
{circle, 5.5, 161.5}
{circle, 18.5, 5.5}

and AUTOCAD only recognizes

circle 5.5,57.5 

circle 5.5,57.5 

circle 5.5,57.5 

...

How can I get rid of the {} and the undesired comma between circle and the numbers?

rhermans
  • 36,518
  • 4
  • 57
  • 149
user1111
  • 67
  • 4
  • ExportString[Insert[#, ",", 3] & /@ data, "Table", "FieldSeparators" -> " ", Alignment -> Right]? – kglr Aug 21 '19 at 12:54

2 Answers2

2
ExportString[{{circle, 5.5, 57.5},
  {circle, 5.5, 109.5},
  {circle, 5.5, 161.5},
  {circle, 18.5, 5.5}}
 , "TSV"
 , "TextDelimiters" -> ""
 ]
circle    5.5 57.5
circle    5.5 109.5
circle    5.5 161.5
circle    18.5    5.5

enter image description here or

ExportString[{{circle, 5.5, 57.5},
  {circle, 5.5, 109.5},
  {circle, 5.5, 161.5},
  {circle, 18.5, 5.5}}
 , "Table"
 ]

You may be interested on looking into the options: Alignment, CharacterEncoding and "FieldSeparators" too.

You can use Export instead of ExportString to save into a file

rhermans
  • 36,518
  • 4
  • 57
  • 149
-1

You might find useful this question: How to export data to a plain text file?

In the end, the option field separators is the one option that you might be looking for as they said before.