Why 'store... !csvLine' inserts double quotes no matter what?


#1

When I try to store my string in always inserts double quotes (").

store | \n | var

var = “\n”

Even if I put single quotes or even double quotes it does it anyways.

store | ‘\n’ | var

var = “’\n’”

store | “\n” | var

var = “”\n""

But storeText has no such problem. It stores the exact piece from the DOM.

storeEval might give me the result i need, BUT if there is a slash" or " in the line its done… more " on both sides of the full line.

Please help.


#2

I don’t see or understand this problem yet, where is the additional “”? Here is my test:

{
  "CreationDate": "2018-9-17",
  "Commands": [
    {
      "Command": "store",
      "Target": "abc 123",
      "Value": "aaa"
    },
    {
      "Command": "echo",
      "Target": "aaa = ${aaa}",
      "Value": "blue"
    },
    {
      "Command": "store",
      "Target": "\\n",
      "Value": "aaa"
    },
    {
      "Command": "echo",
      "Target": "aaa = xxx${aaa}yyy",
      "Value": "green"
    }
  ]
}


#3

Ok. Try this:

{

“CreationDate”: “2018-9-18”,
“Commands”: [
{
“Command”: “store”,
“Target”: "\n, , , ",
“Value”: “!csvLine”
},
{
“Command”: “csvSave”,
“Target”: “test”,
“Value”: “”
}
]
}

Now see the result in csv:


#4

Ok, now I understand. It seems the !csvLine documentation was not very clear about this.

When pushing data into !csvLine, you need to store every value separately. Because once csvSave is called, every value that is stored in the !csvLine internal array will get wrapped with “…” automatically (if needed) before saving.

Example:

csvline

{
  "CreationDate": "2018-9-18",
  "Commands": [
    {
      "Command": "store",
      "Target": "first column text here",
      "Value": "!csvLine"
    },
    {
      "Command": "store",
      "Target": "/n",
      "Value": "!csvLine"
    },
    {
      "Command": "store",
      "Target": "",
      "Value": "!csvLine"
    },
    {
      "Command": "store",
      "Target": "\"great\" she said",
      "Value": "!csvLine"
    },
    {
      "Command": "store",
      "Target": "5th column",
      "Value": "!csvLine"
    },
    {
      "Command": "csvSave",
      "Target": "testcsv",
      "Value": ""
    }
  ]
}

Unwanted double quote in saved csv file
#5

This does not make any more sense to it.
Who defines the “need” for that?
Even if you try so save empty line with “” it will double wrap it again “”""".
Is there a need? I doubt that.
And THE most important thing:
Try saving next line (\n). In your example /n is not next line.
This wraps it up in “” which is a total disaster.
And if there is a need for that it is completely messed up my friend.
You cannot start a next line without double quotes.
This puts HUGE restrictions on working with csv file.

If this cannot be fixed how do I store data to file directly without middle array that messes up the output?


#6

It works fine with\n as well. It gets sourrend by “” as per the CSV file format definition. I guess I do not understand your goal correctly: Do you actually want to save a CSV file, or do you want to create some other file format?

cnn


#7

The goal is to use special characters.
\n
\"
etc…

Here is the case for you:

I collect data which I analyze later in calc (LibreOffice Excell substitute)

I need to break the line which I do by saving file every-time I need to, but this is a workaround. I should have just use \n.

Next I need to insert a link and if just put href it is not clickable. So I need to insert =HYPERTEXT(“link”,“click”)
But I cannot store \" it does wrap whole line with doublequotes which makes everything useless.

Definitely there should not be mandatory doublequotes wrap. If everything is messed up because of my mistake not putting quotes this is one thing. But if I cannot do certain things because somebody decided to help and wrap a text for me with quotes this is another.

I’m not sure if I explain correctly. Sorry about that.
Can you see why double quotes are a problem?