This works great! Anyone that’s not used Sublime Text and is new and trying to goof around with data sets should check this out.
In the find and replace command (Cntrl+H) put these in Find: ^\n = remove an empty row in a data set 0 1 2 3 4 5 6 7 8 Becomes 0 1 2 3 4 5 6 7 8 \s = remove empty white space in say a float or int array 0, 1, 2, 3.14 Becomes 0,1,2,3.14 \s+ = format a string sentence and have 1 space only between words (in replace field just keyboard 1 space) This and that. Plus this. This and that. Plus this. From: maya_h...@googlegroups.com [mailto:maya_h...@googlegroups.com] On Behalf Of Nathan Shipley Sent: Sunday, May 23, 2021 1:36 PM To: maya_h...@googlegroups.com Subject: Re: [maya_he3d] Replace empty space from txt files +1 to Sublime Text for tasks like this. You can search/replace with regular expressions, so this post, for examples shows a way: https://forum.sublimetext.com/t/ability-to-remove-extra-spaces-between-text/15573 I frequently use it to convert text on separate lines to a comma-separated, for example. Also the ability to use multiple cursors at the same time is really useful. On Sun, May 23, 2021 at 2:12 PM Anthony Enos <anthonye...@gmail.com <mailto:anthonye...@gmail.com> > wrote: Not sure if/how directly in Mel, but I think you can remove them with a find/replace using Sublime text (free, great text editor). Pretty good search/replace features, even on multiple files at the same time. That’s my best guess without it in front of me. On May 23, 2021, at 10:57 AM, bobrobertuma <bobrobert...@gmail.com <mailto:bobrobert...@gmail.com> > wrote: Hey all, how using mel, would I take an array like this that comes from Excel file that’s copied into notepad etc? 30 34 0 9 pCube1, 0, 0, 0, 0, 0, 0, 1, 1, 1 Etc. string $array_mixed[] = {30 34 0 9 pCube1, 0, 0, 0, 0, 0, 0, 1, 1, 1 }; and format it to be {30, 34, 0, 9, pCube1, 0, 0, 0, 0, 0, 0, 1, 1, 1} In other words I don’t see how to remove tab and empty space using commands “strip” “tokenize” “substituteAllString” and my mel is very spotty. Jason -- You received this message because you are subscribed to the Google Groups "maya_he3d" group. To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+unsubscr...@googlegroups.com <mailto:maya_he3d+unsubscr...@googlegroups.com> . To view this discussion on the web visit https://groups.google.com/d/msgid/maya_he3d/001401d74ffd%2415015cd0%243f041670%24%40gmail.com <https://groups.google.com/d/msgid/maya_he3d/001401d74ffd%2415015cd0%243f041670%24%40gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "maya_he3d" group. To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+unsubscr...@googlegroups.com <mailto:maya_he3d+unsubscr...@googlegroups.com> . To view this discussion on the web visit https://groups.google.com/d/msgid/maya_he3d/D3EA82E0-E263-4487-835C-2BD006D017BB%40gmail.com <https://groups.google.com/d/msgid/maya_he3d/D3EA82E0-E263-4487-835C-2BD006D017BB%40gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "maya_he3d" group. To unsubscribe from this group and stop receiving emails from it, send an email to maya_he3d+unsubscr...@googlegroups.com <mailto:maya_he3d+unsubscr...@googlegroups.com> . To view this discussion on the web visit https://groups.google.com/d/msgid/maya_he3d/CAMtaTCxuFuDXT1xjHZ23R4TNt_MCuKAwsc-ja_ovcpiuZq%2BNrg%40mail.gmail.com <https://groups.google.com/d/msgid/maya_he3d/CAMtaTCxuFuDXT1xjHZ23R4TNt_MCuKAwsc-ja_ovcpiuZq%2BNrg%40mail.gmail.com?utm_medium=email&utm_source=footer> . -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/00a801d750b6%24f94e30c0%24ebea9240%24%40gmail.com.