Jump to content

[B]Double Quotes within a string[/B]


Recommended Posts

Posted

(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.

Posted

Hi Hari-babu,

 

 

use \" , try : (strcat "hi " "Hari-babu") or (strcat "hi "\"Hari-babu\"") to see the difference...

 

 

gr. Rlx

Posted

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")

Posted
typed in command prompt:

 

Command: (strcat "hi "\"Hari-babu\"")

; error: bad argument type: stringp nil

 

:(

 

 

oops , typed to fast...:oops:

 

 

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

Posted

so far i came until this, but i need another " before D

 

Command: (strcat "(see " "\"notepad\"" " " filepath ")")

"(see \"notepad\" D:\\test\\csvextract\\errorlog.txt)"

Posted

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)
)

Posted
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 "\")")

Posted

:excited:

 

yes, that is so great for me.

 

:thumbsup:

 

Thank You Boss.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...