Thread: Export problems
View Single Post
  #5  
Old 07-08-2021, 07:19 AM
Spliff Spliff is online now
Registered User
 
Join Date: 04-07-2021
Posts: 72
I should add that, whilst the above-mentioned tools correctly analyze UR's csv export (which implies that it's absolutely correct), for a layman, core csv analysis (i.e. "element retrieval" from csv which uses commata as field delimiter) is a nightmare, as soon as you also have double-quotes within Item Title and Item Text in this UR use case; "easy" "how-to-do's" from the web are unreliable, and whilst there exist "libraries" (e.g. "Ron's" above seems to use "CellParserSeparatorWrappedRes" (whatever that may be)), you're left alone in and with your tries to write a - reliable in any situation! - script.

(Of course, you could use some csv tool (which renders it all correctly, as said above), then use that tool to shift the field separator "comma" to some of your liking (e.g. "|" (which may occur in some third-party files though but which you could replace by "-" in those texts, possibly)), then only do the necessary scripting, using that third-party tool's output, but that's not how I see things, i.e. that's not an acceptable workflow for me.

Thus, I came up with two solution for me, you could make up others.

First, do a dummy csv export, with "Export attribute names as first row" checked = "yes", in order to get UR csv's export attributes order; it seems to be

"Keywords (user-defined)","Item Title","Date Created","Date Modified","Date Accessed",Flag,ItemID,"Parent Title","Date Deleted","Original Parent","Template Item","Access Count","Web Site",Company,"Indent Level",Lineage,"Item Text","Begin Date","Begin Time",Reminder,"Pending Reminder","End Date","End Time",Recurring,"Original Begin",Location,"Has Reminder","Date Completed","Billing Info",Mileage,"Completed %","Work Actual","Work Total",Priority,"Search Locked","Search TitleOnly","Search Whole Words","Search Manual Keyword Only","Tree Order","Object Exists",Attachments,"Phone (Fax)","Phone (Work)","Email (Home)","Phone (Mobile)","Due Date","Phone (Home)","Postal Code",State,Address,"Email (Work)","Middle Name",City,"Item Notes",BCC,CC,"Sync Date","Document Size",Encoding,Country,Newsgroups,"First Name","Last Name","Default Child Template","Message Date",URL,To,From,"Camera Model","Date Picture Taken",Artist,"Album Title",Author

in my tries and is different from the attributes order within the export dialogue.

Then, decide which attributes will never occur in your exports, which means that they will produce just a comma in UR's export file, and create groups of such empty output fields, which will then serve you as field indicators for the "real" fields.

In my case, needing Item Title, Flag, Indent Level (!) and Item Text (but NOT using user-defined keywords), I export:

"Keywords (user-defined)","Item Title",Flag,"Web Site",Company,"Indent Level","Item Text", this way getting distinct field, and new-item indicators (the user-defined keywords attribute giving me a leading comma (i.e. on position 1) as new-indicator).

If your user-defined keywords are NOT empty, you could use "Keywords (user-defined)","Item Title",Flag,"Web Site",Company,"Indent Level","Item Text",Address,City,Country instead (i.e. if you don't use those attributes for real data somewhere), which would give you four (if "Text" is empty) or at least 3 (if it's not) trailing commata, and from there, you would not have a "begin item", but an equally distinct "end item" indicator, which is as good for then writing a reliable analysis-and-process script.

This being said, and except for the nuisance of it also producing (hundreds, in case) unwanted html folders and files (in the current use case of just wanting plain text export (with markdown codings or not)), UR's above-described xml export, whilst producing less-human-readable output on first sight, is distinct from start-on, and without the need of csv analysis tools or the need of creating a bunch of empty attributes, in order to distinguish the exported attributes from each other.


From the above, I would kindly suggest:

- to create a csv output format where the user could enter their special character which will then serve as field separator

- to create a subset of the xml "html: none" output where "html: none" will be what it already promises: just the xml file as the only output

- to create several export "situations", "scenarios", since currently, for perfect csv output, you would need to select a specific attributes group, which may be considered to be a little bit "very specific", and then, for "ordinary", "regular" output, you will have to destroy that attributes selection, in order to enter another one, and so on again, so some presets, perhaps 6 or so, to freely choose from, would come really handy, or then, distinct presets for the different output formats, i.e. one for csv, a different one for xml, and so on.

The above does in no way imply you couldn't create perfect output from UR even today, it's just a little bit cumbersome currently to do so.

Last edited by Spliff; 07-08-2021 at 07:26 AM.
Reply With Quote