hari-babu Posted January 22, 2016 Posted January 22, 2016 (setq FILEPATH "D:\\test\\csvextract\\Errorlog.txt") ;[b]FILEPATH[/b] is a variable I want to write below line as it is to a text file. Assume that is "D:\\dummy.txt" (see "notepad" "D:\\test\\csvextract\\Errorlog.txt") I want to use FILEPATH variable to achieve the above line in that text file. please help. Quote
rlx Posted January 22, 2016 Posted January 22, 2016 Hi Hari-babu, use \" , try : (strcat "hi " "Hari-babu") or (strcat "hi "\"Hari-babu\"") to see the difference... gr. Rlx Quote
hari-babu Posted January 22, 2016 Author Posted January 22, 2016 typed in command prompt: Command: (strcat "hi "\"Hari-babu\"") ; error: bad argument type: stringp nil i have corrected that: Command: (strcat "hi " "\"Hari-babu\"") "hi \"Hari-babu\"" But this line is too complex for me. by using a variable filepath. (see "notepad" "D:\\test\\csvextract\\Errorlog.txt") Quote
rlx Posted January 22, 2016 Posted January 22, 2016 typed in command prompt: Command: (strcat "hi "\"Hari-babu\"") ; error: bad argument type: stringp nil oops , typed to fast... better example : (action_tile "ask" "(setq #RplAddOnStartup \"0\")") , for use in a dialog action tile (write-line "(setvar \"sdi\" 1)" fp) , for use to write to a script file , so the line written will be (setvar "sdi" 1) Hopes this is a correct example gr. Rlx Quote
hari-babu Posted January 22, 2016 Author Posted January 22, 2016 so far i came until this, but i need another " before D Command: (strcat "(see " "\"notepad\"" " " filepath ")") "(see \"notepad\" D:\\test\\csvextract\\errorlog.txt)" Quote
satishrajdev Posted January 22, 2016 Posted January 22, 2016 Just see my example :- (defun c:1 (/ a b c) (setq a (getfiled "Specify Output File" "c:/" "txt" 1)) (setq b (open a "w")) (setq c "D:\\test\\csvextract\\Errorlog.txt") (write-line (strcat "see \"notepad\" \"" c "\"") b) (close b) (prompt (strcat "\nFile = " a)) (princ) ) Quote
satishrajdev Posted January 22, 2016 Posted January 22, 2016 so far i came until this, but i need another " before D Command: (strcat "(see " "\"notepad\"" " " filepath ")") "(see \"notepad\" D:\\test\\csvextract\\errorlog.txt)" Check it (strcat "(see \"notepad\" \"" filepath "\")") Quote
hari-babu Posted January 22, 2016 Author Posted January 22, 2016 yes, that is so great for me. Thank You Boss. Quote
Lee Mac Posted January 22, 2016 Posted January 22, 2016 See here for a program to construct this string automatically. 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.