I'm trying to save some time generating a lot of reports on Excel with a program from Stata using the putexcel command.
It has worked perfectly. However, I'm encountering a problem when mixing 3 formulas in which one includes quotation marks to denote a space " ".
To be more specific, this is the code I'm using:
putexcel B2=formula("IF((VLOOKUP(A2;HI!$1:$1048576;2;));" ";VLOOKUPA2;HI!$1:$1048576;2;))") using "`archivo'", modify sheet("DEFGGF")
The problem here is that it works in Excel, but instead of the space enclosed in " " I'm getting a 0 since it doesn't read the quotation marks.
I have tried enclosing the "" in several other ways, like
'""`
or
"'"'`"`"
but they don't work.
I would post this as a comment, but I never am able to get the backtick (`) character to display properly in a comment.
I think your code should look like
putexcel B2=formula(`"IF((VLOOKUP(...));" ";VLOOKUP(...))"') using ...
but I admit to not having tested this solution. But the general principles involved are explained in the output of the Stata command help quotes##double.
Related
I've done a lot of googling and no solution I've found works for me.
Under the screenshot I have translated what it says.
=IF(ISBLANK([ToDate]),"",[ToDate]-[DaysToWarn]
This only throws an syntax error. I've tried many different solutions but none of which seems to work.
I even built a replica in my test environment to see if that worked, which it did. I'm out of options and I don't know what I am doing wrong.
The problem, most likely, is due to the parameter separator. The documentation says:
All example formulas in this topic use commas "," as the parameter delimiter character. In some countries, the comma is reserved for use as the decimal mark. In such countries, users creating a calculated field must use semi-colons ";" as the delimiter character.
If I'm correct to assume your localization is Swedish, the decimal separator is ',' (comma), and hence the parameter separator to be used shall be ';' (semicolon).
=IF(ISBLANK([ToDate]); ""; [ToDate]-[DaysToWarn])
Yes, we can convert tabs to spaces via Sublime, VS-Code and etc, it's not a big problem.
But what if I want to get rid off this additional action ?
Found answer by adding this line to .nim file :
#? replace(sub = "\t", by = " ")
My additional question is :
What is this #?, how this thing works and what kind of variations I can find also, for example:
#!
#some_chinese_character
It is called a "source code filter", it's like a Nim preprocessor less powerful than macros and templates. You can read about it here: https://nim-lang.org/docs/filters.html
Anyway, I wouldn't recommend using it, but rather using an editor which replaces tabs with spaces, such as vscode. This seems more like an hack than an actual solution.
I'm using the BASIC language. Is there any way to include double quotes in a string?
I tried using \" but it doesn't work.
NOTE: I'm using Nano-10 PLC which supports combination of Ladder and BASIC
#vlad awtsu's answer is correct for the normal BASIC language. (+1 for him)
However it didn't work for me on the PLC I've mentioned in the question.
Using CHR$(&H22) did the job for me. (also works on normal BASIC)
Print "Hello "+ CHR$(&H22) +"World"+CHR$(&H22)
It prints:
Hello "World"
try this one
"She said, ""You deserve a treat!"" "
add "" ""
Dushyant Bangal is correct - although CHR$(34) should work equally well. There is no need to put the value into hex unless you have a preference for it.
(Also, whether doubling up the "" works in "normal BASIC" depends what you mean by "normal". I've seen countless dialects in which CHR$ is the only option.)
Could anybody tell me what is wrong with the below formula? I think it is something to do with a comma but not sure. Continuously get an error with this.
=IF(S2="customer”,”551”,IF(S2=“business”,”552”,IF(S2=“both”,”551, 552”, “”)))
It appears that you are somehow using quotes that are not recognized by Excel (if the formula you are using is the exact same as the one you posted).
For example, notice how “” (from your formula) is different than "" (the accepted characters).
As others have stated, this works: =IF(S2="customer","551",IF(S2="business","552",IF(S2="both","551, 552", "")))
If you are in a non-US locale you may need to use semicolons ; instead of commas ,. Try with ; instead of ,
=IF(S2="customer";551;IF(S2="busines2";552;IF(S2="both";"551,552";"")))
This works in my excel table.
Try this...
=IF(S2="customer","551",IF(S2="business","552",IF(S2="both","551, 552", "")))
What kind of error are you getting? I put it in as the below and all 4 returns work correctly. Looks the same as yours to me but here it is to be on the safe side.
=IF(S2="customer","551",IF(S2="business","552",IF(S2="both","551, 552","")))
I would like to be able to change the way Maxima generates the LaTeX code (in general). For example, I have the following code in Maxima:
I then exported the code to LaTeX, and I immediately get an error saying:
! Package inputenc Error: Unicode char \u8:− not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
You can check out the LaTeX code generated through this gist on GitHub.
I would like at least not only to not get any errors, but also to change a little bit the style of the LaTeX code generation to adapt it to certain circumstances. For example, I would like to be able to insert a break line (or more) after the outputs...
Is it possible to do? Are there any alternatives?
You can put the following line in the preamble of the LaTeX output:
\DeclareUnicodeCharacter{2212}{-}
which tells LaTeX what to do with the Unicode hyphen (character 2212 according to this table).
WxMaxima should generate this declaration itself -- it is a bug that it does not.
Most likely something happened when you exported the code. To fix the existing file you can follow the accepted answer to this question.
https://tex.stackexchange.com/questions/83440/inputenc-error-unicode-char-u8-not-set-up-for-use-with-latex
But try exporting again and see if the error was accidental.
Update:
Add
\DeclareUnicodeCharacter{00A0}{ }
to your preamble.
Well, the gistfile1.txt at line 54 contains − characters instead of -. I wonder how those characters were generated. What commands did you enter in wxMaxima to generate gistfile1.txt?
Anyway, I find that if I replace those characters with ordinary hyphens, it avoids the error you reported. So perhaps the problem is to avoid generating those characters in the first place.
EDIT: This answer is off the mark. See my other answer for a real solution.