cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-40758%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%E6%96%87%E5%AD%97%E5%88%97%E5%86%85%E3%81%AE%E4%BA%8C%E9%87%8D%E5%BC%95%E7%94%A8%E7%AC%A6%E3%82%92%E7%BD%AE%E3%81%8D%E6%8F%9B%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-40758%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E5%85%A8%E3%81%A6%E3%80%81%3C%2FP%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%AF%E9%9D%9E%E5%B8%B8%E3%81%AB%E5%8D%98%E7%B4%94%E3%81%AA%E3%82%88%E3%81%86%E3%81%AB%E8%A6%8B%E3%81%88%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E9%9D%9E%E5%B8%B8%E3%81%AB%E3%82%A4%E3%83%A9%E3%82%A4%E3%83%A9%E3%81%99%E3%82%8B%E4%BD%9C%E6%A5%AD%E3%81%A7%E3%81%99%E3%80%82%20%E6%96%87%E5%AD%97%E5%88%97%E5%86%85%E3%81%AE%E5%BC%95%E7%94%A8%E7%AC%A6%E3%82%92%E7%BD%AE%E3%81%8D%E6%8F%9B%E3%81%88%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%E3%80%82%3C%2FP%3E%3CP%3E%E6%AC%A1%E3%81%AE%E5%88%97%E3%81%8C%E3%81%82%E3%82%8B%E3%81%A8%E3%81%97%E3%81%BE%E3%81%97%E3%82%87%E3%81%86%20(Inv%2001%E3%80%81Inv%2002%20...%20%E8%A6%8F%E5%89%87%2026)%20%E3%80%82%3C%2FP%3E%3CP%3E%E3%81%9D%E3%81%93%E3%81%A7%E3%80%81%E5%88%97%E5%90%8D%E3%82%92%E5%8F%96%E5%BE%97%E3%81%97%E3%81%A6%E6%AC%A1%E3%81%AE%E3%82%88%E3%81%86%E3%81%AA%E6%9D%A1%E4%BB%B6%E3%82%92%E4%BD%9C%E6%88%90%E3%81%97%E3%81%BE%E3%81%97%E3%81%9F%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EStmt%20%3D%20%22%22%3B%0Afor(i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(InvColNames)%2C%20i%2B%2B%2C%0A%20%20%20%20%20%20%20%20If(i%20%3D%3D%201%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Stmt%20%3D%20%22%3A%22%20%7C%7C%20InvColNames%5Bi%5D%20%7C%7C%20%22%20%26gt%3B%3D%201%20%26amp%3B%22%20%7C%7C%20%22%3A%22%20%7C%7C%20InvColNames%5Bi%5D%20%7C%7C%20%22%20%26lt%3B%3D%20InvLimit%22%20%3B%0A%20%20%20%20%20%20%20%20%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Stmt%20%3D%20Stmt%20%7C%7C%20%22%20%26amp%3B%20%22%20%7C%7C%20%22%3A%22%20%7C%7C%20InvColNames%5Bi%5D%20%7C%7C%20%22%26gt%3B%3D%201%20%26amp%3B%22%20%7C%7C%20%22%3A%22%20%7C%7C%20InvColNames%5Bi%5D%20%7C%7C%20%22%20%26lt%3B%3D%20InvLimit%22%20%20%3B%20%0A%20%20%20%20%20%20%20%20%20%20)%20%3B%0A%20%20%20%20)%3B%0A%22%3AInv%2001%20%26gt%3B%3D%201%20%26amp%3B%3AInv%2001%20%26lt%3B%3D%20InvLimit%20%26amp%3B%20%3AInv%2002%26gt%3B%3D%201%20%26amp%3B%3AInv%2002%20%26lt%3B%3D%20InvLimit%20%26amp%3B%20%3AInv%2003%26gt%3B%3D%201%20%26amp%3B%3AInv%2003%20%26lt%3B%3D%20InvLimit%22%20%3C%2FPRE%3E%3CPRE%3EStmt%20%3D%20Substitute(Stmt%2C%20%22%5C!%22%22%2C%20%22%22)%3B%20%0AInvStatusExpr%20%3D%20Expr(dt_Inp%20%26lt%3B%26lt%3B%20New%20Column(%22Status_Inv%22%2CNumeric%2CContinuous%2CFormula(Expr(Stmt))))%3B%0AEval(Eval%20Expr(InvStatusExpr))%3B%3C%2FPRE%3E%3CP%3E%E7%A7%81%E3%81%8C%E4%BD%9C%E6%88%90%E3%81%97%E3%81%9F%E6%9D%A1%E4%BB%B6%E3%82%92%E5%BC%8F%E3%81%A8%E3%81%97%E3%81%A6%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81%E6%9D%A1%E4%BB%B6%E3%82%92%E5%AE%9A%E7%BE%A9%E3%81%97%E3%81%A6%E3%82%82%E3%82%89%E3%81%84%E3%81%9F%E3%81%84%E3%81%A8%E8%80%83%E3%81%88%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%20%E3%81%9F%E3%81%A0%E3%81%97%E3%80%81%E5%95%8F%E9%A1%8C%E3%81%AF%E7%8F%BE%E5%9C%A8%E3%81%AE%E5%BD%A2%E5%BC%8F%E3%81%AB%E3%81%82%E3%82%8A%E3%80%81%E7%A7%81%E3%81%8C%E4%BD%9C%E6%88%90%E3%81%97%E3%81%9F%E3%80%8CStmt%E3%80%8D%E3%81%AF%E4%BA%8C%E9%87%8D%E5%BC%95%E7%94%A8%E7%AC%A6%E3%81%A7%E5%9B%B2%E3%81%BE%E3%82%8C%E3%81%A6%E3%81%8A%E3%82%8A%E3%80%81%E6%96%87%E5%AD%97%E5%88%97%E3%81%A8%E3%81%97%E3%81%A6%E8%A9%95%E4%BE%A1%E3%81%95%E3%82%8C%E3%80%81%E4%BD%9C%E6%88%90%E3%81%97%E3%81%9F%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%81%8C%E6%96%B0%E3%81%97%E3%81%84%E5%88%97%E3%81%AB%E5%85%A5%E5%8A%9B%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8B%E3%81%9F%E3%82%81%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E6%96%87%E5%AD%97%E5%88%97%E5%86%85%E3%81%AE%E4%BA%8C%E9%87%8D%E5%BC%95%E7%94%A8%E7%AC%A6%E3%82%92%E7%BD%AE%E3%81%8D%E6%8F%9B%E3%81%88%E3%81%A6%E3%81%93%E3%82%8C%E3%82%92%E6%A9%9F%E8%83%BD%E3%81%95%E3%81%9B%E3%82%8B%E7%B0%A1%E5%8D%98%E3%81%AA%E6%96%B9%E6%B3%95%E3%82%92%E8%AA%B0%E3%81%8B%E3%81%8C%E6%95%99%E3%81%88%E3%81%A6%E3%81%8F%E3%82%8C%E3%81%9F%E3%82%89%E3%80%81%E5%8A%A9%E3%81%91%E3%81%A6%E3%81%84%E3%81%9F%E3%81%A0%E3%81%91%E3%82%8C%E3%81%B0%E5%B9%B8%E3%81%84%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%226-19-2017%203-41-33%20PM.png%22%20style%3D%22width%3A%20282px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%226-19-2017%203-41-33%20PM.png%22%20style%3D%22width%3A%20282px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%226-19-2017%203-41-33%20PM.png%22%20style%3D%22width%3A%20282px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F6508i91BE0C39F5B10BF5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%226-19-2017%203-41-33%20PM.png%22%20alt%3D%226-19-2017%203-41-33%20PM.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E4%B8%80%E7%95%AA%3C%2FP%3E%3CP%3E%E3%82%A6%E3%83%80%E3%82%A4%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-40777%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%E6%96%87%E5%AD%97%E5%88%97%E5%86%85%E3%81%AE%E4%BA%8C%E9%87%8D%E5%BC%95%E7%94%A8%E7%AC%A6%E3%82%92%E7%BD%AE%E3%81%8D%E6%8F%9B%E3%81%88%E3%82%8B%E6%96%B9%E6%B3%95%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-40777%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EEval(%20Parse(%20Eval%20Insert()%20%E3%81%AF%E3%80%81%E6%9C%AC%E5%BD%93%E3%81%AB%E8%A1%8C%E3%81%8D%E8%A9%B0%E3%81%BE%E3%81%A3%E3%81%9F%E3%81%A8%E3%81%8D%E3%81%AB%E5%95%8F%E9%A1%8C%E3%82%92%E8%A7%A3%E6%B1%BA%E3%81%97%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E3%82%B3%E3%83%BC%E3%83%89%E3%81%AE%E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%81%8C%E9%9B%A3%E3%81%97%E3%81%84%E3%81%9F%E3%82%81%E3%80%81%E6%9C%80%E5%BE%8C%E3%81%AE%E6%89%8B%E6%AE%B5%E3%81%A8%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%E5%9F%BA%E6%9C%AC%E7%9A%84%E3%81%AB%E3%81%AF%E3%80%81%E6%96%87%E5%AD%97%E5%88%97%E3%82%92%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88%E3%81%A8%E3%81%97%E3%81%A6%E7%9B%AE%E7%9A%84%E3%81%AE%20JSL%20%E3%81%AB%E6%8C%BF%E5%85%A5%E3%81%97%E3%80%81JSL%20%E3%82%92%E8%A9%95%E4%BE%A1%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%5E%5E%20%E3%81%AF%E3%80%81%E6%8C%BF%E5%85%A5%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%AB%E4%BD%9C%E6%A5%AD%E5%A0%B4%E6%89%80%E3%82%92%E6%8C%87%E7%A4%BA%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3EEval(%20Parse(%20Eval%20Insert(%22%5C%5B%26nbsp%3Bdt_Inp%20%26lt%3B%26lt%3B%20New%20Column(%22Status_Inv%22%2CNumeric%2CContinuous%2CFormula(%5EStmt%5E))%3B%20%5D%5C%22%20)%20)%20)%3B%3C%2FPRE%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%AF%E5%8B%95%E7%9A%84%20JSL%20%E3%81%A8%E5%91%BC%E3%81%B0%E3%82%8C%E3%80%81%E9%9D%9E%E5%B8%B8%E3%81%AB%E5%BC%B7%E5%8A%9B%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
uday_guntupalli
Level VIII

How to replace double quotes in string

All, 

    This seems to be fairly simple but extremely frustrating task . How do I replace quotation marks in a string . 

    Let us say , I have the following columns ( Inv 01 , Inv 02 ... Inv 26) . 

    So, I acquired the column names and built a condition like so : 

 

Stmt = "";
for(i = 1, i <= N Items(InvColNames), i++,
        If(i == 1,
               Stmt = ":" || InvColNames[i] || " >= 1 &" || ":" || InvColNames[i] || " <= InvLimit" ;
	       ,
               Stmt = Stmt || " & " || ":" || InvColNames[i] || ">= 1 &" || ":" || InvColNames[i] || " <= InvLimit"  ; 
          ) ;
    );
":Inv 01 >= 1 &:Inv 01 <= InvLimit & :Inv 02>= 1 &:Inv 02 <= InvLimit & :Inv 03>= 1 &:Inv 03 <= InvLimit" 
Stmt = Substitute(Stmt, "\!"", ""); 
InvStatusExpr = Expr(dt_Inp << New Column("Status_Inv",Numeric,Continuous,Formula(Expr(Stmt))));
Eval(Eval Expr(InvStatusExpr));

I wish to them use the condition I built as an expression and define a condition . The problem though is in its current form , since the "Stmt" I built is enveloped in double quotes, it is being evaluated as a string and the statement I built is being populated into the new column. 

 

If someone can show me a simple way to replace double quotes in a string and get this to work , I would appreciate the help . 

 

 

6-19-2017 3-41-33 PM.png

 

 

Best 

Uday 

 

 

 

 

 

Best
Uday
1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to replace double quotes in string

Eval( Parse( Eval Insert( will get you out of trouble when you are really stuck but should be a last resort as the code is hard to debug.

 

Basically you are inserting your string as text into the desired JSL and than evaluating the JSL. The ^^ tells the Insert Command where to work.

 

Eval( Parse( Eval Insert("\[ dt_Inp << New Column("Status_Inv",Numeric,Continuous,Formula(^Stmt^)); ]\" ) ) );

This is called dynamic JSL which can be very powerful.

View solution in original post

1 REPLY 1

Re: How to replace double quotes in string

Eval( Parse( Eval Insert( will get you out of trouble when you are really stuck but should be a last resort as the code is hard to debug.

 

Basically you are inserting your string as text into the desired JSL and than evaluating the JSL. The ^^ tells the Insert Command where to work.

 

Eval( Parse( Eval Insert("\[ dt_Inp << New Column("Status_Inv",Numeric,Continuous,Formula(^Stmt^)); ]\" ) ) );

This is called dynamic JSL which can be very powerful.

Recommended Articles