Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[solved] best way to store paragraphs per file entry?

I have unique paragraphs of text that I want to store and fetch easily.

I tried using spreadsheets but they're too slow to use when fetching data.

I tried using setfile and get file, but when I store the strvar.getfile into an array, the array elements will wrongly tokenize the data based on new lines, which some paragraphs have. So, some paragraphs get split up, which I wish to avoid.

Here's some sample data







If all goes well, that should be 3 array elements.

Use CSV file or Sqlite database.
CSV is easier. It is good if it must be a text file, and the file will not be very big.
Or use str function escape() to replace new lines to QM string escape sequence [].
I'm trying to use icsv to write to a csv

I modded the help file code to use my file path and the code worked, but today, I keep getting this error. I'm totally confused.

Copy      Help
str s ss
ICsv v._create

int nr=v.RowCount
int nc=v.ColumnCount
int r c
for r 0 nr
    out "--- row %i ---" r
    for c 0 nc
        s=v.Cell(r c)
        out s
        v.Cell(r c)=s

out ss

Error (RT) in Macro: 0x80070057, The parameter is incorrect. ?
Probably the file contains invalid CSV. For example, " is non-escaped or non-closed.
I select all and deleted everything - even deleted extra sheets.

Still has same error though.
What text now is in C:\test\test.csv?
And in which line error?
Ahh, I see what happened.

I had to create a new text manual (windows explorer, right click, text file), rename it to test.csv OR open the spreadsheet program and save a blank file as test.csv.

I think I was in windows explorer, right click, make new xlsx file, renamed it to test.csv and the file structure was still xlsx so it was unrecognized by quickmacros.

Forum Jump:

Users browsing this thread: 1 Guest(s)