Daten in Mathematica drucken

384
Pipe

Ich habe ein Problem beim Drucken von Daten in Mathematica. Wenn die Leitung zum Beispiel so lang ist

S = 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111

Ich möchte S in Form zuerst fünf Leerzeichen drucken, dann "#" setzen, dann 66 Leerzeichen von S, dann die nächste Reihenfolge erneut eingeben. Dieses Formular muss in WordPad wie hier geöffnet sein

 "5 spaces empty"#1111111111"(66times)"111111 "5 spaces empty"#1111111111"(66times)"111111 ..... 

Schöne Grüße,

0

1 Antwort auf die Frage

1
Bill

Sie können den folgenden Code verwenden:

In[58]:= S=1111111111111111111111111111111111111111111111111111111111111111111111111111\ 111111111111111111111111111111111111111111111111111111111111111111111111111111\ 111111111111111111111111111111111111111111111111111111111111111111111111111111\ 111111111111111111111111111111111111111111111111111111111111111111111111111111\ 1111111111111111111111111111111111111111111111111111; StringPartition[s_,l_]:=Table[StringTake[s,],]; fmts=Map[(" #"<>#<>"\r")&,StringPartition[ToString[S],66]]; (* Unfortunately the web software is ruining the formatting of the output, deleting the extra spaces I placed before the #, etc. *) (* But if you fix all the things this web software broke when I pasted your result and then run this and check the output carefully you should see it is correct *) FullForm[fmts]  Out[61]//FullForm= List[ " #111111111111111111111111111111111111111111111111111111111111111111\r", " #111111111111111111111111111111111111111111111111111111111111111111\r", " #111111111111111111111111111111111111111111111111111111111111111111\r", " #111111111111111111111111111111111111111111111111111111111111111111\r", " #111111111111111111111111111111111111111111111111111111111111111111\r", " #11111111111111111111111111111111\r" ] 
Vielen Dank, dass es funktioniert. Nur um etwas zu prüfen und ich werde dir schreiben. Pipe vor 12 Jahren 0