• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quoted page numbers in CSV import (and workaround)
#1
An odd little problem: in imported CSV files (with PDF), it seems like page numbers can be quoted, or not quoted, for all entries, but a mixture causes problems.

Of the three samples attached (same data, different delimiters), the 'full quotes' and 'no quotes' versions all get imported as expected, with sensible values for all fields. However, the 'partial quotes' one gets read ok for the first three entries (quoted page ranges), but MSP reports "Pages: 1-1" for all the subsequent, single pages, which are unquoted in the CSV. And subsequent data values on the same line appear in the wrong variable (i.e. genre data appears as 'source type').

Obviously no sensible person would create a CSV with inconsistent delimiters, but the situation arises because of spreadsheet formatting and export filters. LibreOffice (and Excel IIRC) CSV export filters have the option to quote text, which doesn't quote numeric values (e.g. 14). However, page ranges (1-11) have to be entered/formatted as text (otherwise can get treated as dates), which means they get quoted on export, when actual numbers don't.

It's probably very marginal and niche case, so maybe not a high priority, and a couple of workarounds work in case anyone encounters this situation:

1. Don't use " text delimiters on exporting the CSV. I do it for caution, just in case any entries contain semicolons.

2. Format the spreadsheet column containing page numbers as 'Text'. which then ensures all get treated as text and fully quoted.

(MSP Android, v.3.1.8)


Attached Files
.csv   ColoBk (full quotes).csv (Size: 16.24 KB / Downloads: 1)
.csv   ColoBk (no quotes).csv (Size: 13.49 KB / Downloads: 1)
.csv   ColoBk (partial quotes).csv (Size: 15.73 KB / Downloads: 1)
Reply
#2
That's nothing that has to be handled by MSP.
As you already stated: don't use inconsistent CSVs.
If you use either semicolon or tab as field separator, quoting text should not be necessary. You can easily avoid that tabs or semicolons occur within field texts.
To test if a CSV is valid just open it in e.g. Libre Office Calc. If it contains misplaced field separators it will be shown obviously and it's a snap to correct them.
first language: German
Acer A1-830, Android 4.4.2 - HP x2 210 G2 Detachable, Win 10 22H2 - Huawei Media Pad T5, Android 8.0 - Boox Tab Ultra C, Android 11
www.moonlightcrisis.de - www.basdjo.de - www.frankenbaend.de


Reply




Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.