mousho Posted November 1, 2023 Posted November 1, 2023 hi friends i have a sort problem that stop work for me and i try everyhing already and its not working i'm trying to sort the txt file by the place of 8 letter in the file (command "_.Shell" (strcat "sort /+8 <" "C:\Autocad Lisp\mpdlist.txt" ">" "C:\Autocad Lisp\newlist.txt")) or (command "_.Shell" (strcat "sort /+8 <" "C:\\Autocad Lisp\\mpdlist.txt" ">" "C:\\Autocad Lisp\\newlist.txt")) few years ago it did work mpdlist.txt Quote
pkenewell Posted November 1, 2023 Posted November 1, 2023 (edited) 7 hours ago, mousho said: hi friends i have a sort problem that stop work for me and i try everyhing already and its not working i'm trying to sort the txt file by the place of 8 letter in the file (command "_.Shell" (strcat "sort /+8 <" "C:\Autocad Lisp\mpdlist.txt" ">" "C:\Autocad Lisp\newlist.txt")) or (command "_.Shell" (strcat "sort /+8 <" "C:\\Autocad Lisp\\mpdlist.txt" ">" "C:\\Autocad Lisp\\newlist.txt")) @mousho The 2nd option worked fine for me. It has to be the 2nd version because you MUST use the "\\" to create the single "\" in the actual shell command. Make sure the path exists and everything is spelled correctly. I used the following in my test: (command "_.Shell" (strcat "sort /+8 <" "C:\\Temp\\mpdlist.txt" ">" "C:\\Temp\\newlist.txt")) Results: %%17410 1L=520 2 1 1398 %%17410 2L=747 2 1 1398 %%17410 3L=1198 2 1 1398 %%174 8 4L=954 2 1 1398 %%174 8 5L=520 2 1 1398 %%17410 6L=520 14 15 200399 %%17412 7L=747 14 15 200399 %%17412 8L=1198 14 15 200399 %%174 8 9L=954 14 15 200399 %%174 8 10L=520 14 15 200399 Edited November 1, 2023 by pkenewell 1 Quote
mousho Posted November 2, 2023 Author Posted November 2, 2023 10 hours ago, pkenewell said: @mousho The 2nd option worked fine for me. It has to be the 2nd version because you MUST use the "\\" to create the single "\" in the actual shell command. Make sure the path exists and everything is spelled correctly. I used the following in my test: (command "_.Shell" (strcat "sort /+8 <" "C:\\Temp\\mpdlist.txt" ">" "C:\\Temp\\newlist.txt")) Results: %%17410 1L=520 2 1 1398 %%17410 2L=747 2 1 1398 %%17410 3L=1198 2 1 1398 %%174 8 4L=954 2 1 1398 %%174 8 5L=520 2 1 1398 %%17410 6L=520 14 15 200399 %%17412 7L=747 14 15 200399 %%17412 8L=1198 14 15 200399 %%174 8 9L=954 14 15 200399 %%174 8 10L=520 14 15 200399 thx i found that there is a problem with the space in the folder name, the program dont know how to treat with space bar Quote
pkenewell Posted November 2, 2023 Posted November 2, 2023 14 hours ago, mousho said: thx i found that there is a problem with the space in the folder name, the program dont know how to treat with space bar @mousho I figured it out. You need to add embedded quotes into the path arguments using a double quote preceded with the backslash on each end of the parts (i.e. \"): (command "_.Shell" (strcat "sort /+8 <" "\"C:\\Temp\\mpdlist.txt\"" ">" "\"C:\\Temp\\newlist.txt\"")) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.