3
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ ExportString[Insert[#, ",", 3] & /@ data, "Table", "FieldSeparators" -> " ", Alignment -> Right]? $\endgroup$ – kglr Aug 21 at 12:54
1
$\begingroup$
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

$\endgroup$
-1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.