Clarity

  • 1.  Delimiter types

    Posted Mar 13, 2014 05:16 PM

    Hi,

    I have a pretty general question about delimiter types that are allowed when writing to clarity using xog.

    I usually would use a tab or comma delimiter, but I've been given some pretty funky data that is not as neat as what I am used to. I just want to know if there are any other types of delimiters that I could use, or possible even pull straight from a MS Excel spreadsheet before I attempt to go through and reorganize several sets of data that do not belong to me.

    Thanks,

    Tyra



  • 2.  RE: Delimiter types
    Best Answer

    Posted Mar 15, 2014 12:56 AM

    You can use all different sorts of delimiters.

    Here is how you can use the pipe:

    <files:readFile fileName="${vFileName}" delimiter="\|" var="vResourceData" embedded="false"/>
     

    Does this help?



  • 3.  RE: Delimiter types

    Posted Mar 17, 2014 10:19 AM

    Thanks Chris.

    My problem is that I only know of tab delimited and comma delimited files. In this particular case I have a bunch of crazy, decentralized spreadsheets and I was trying to figure out a way to read from these files without having to reorganize the data since I am not the data owner. Usually tab and comma delimited files work fine when the data is "pretty", but this time around the data is a bit messy. I am trying to figure out if there is a better delimiter option for trying to write from these particular spreadsheets before I get permission to condense the data or have the data owners try to reformat it.

    It would be perfect if there was a way to read directly from the excel spreadsheet, but I'm not sure if that is possible.



  • 4.  RE: Delimiter types

    Posted Mar 17, 2014 12:17 PM

    I also like using pipe ‘|’ delimited strings as ‘,’ and ‘tab’ often show up in text fields.

    Save your Excel file with | separator:

    http://www.howtogeek.com/howto/21456/export-or-save-excel-files-with-pipe-or-other-delimiters-instead-of-commas/

    then use Chris' <files:readFile>

    <files:readFile fileName="${vFileName}" delimiter="\|" var="vResourceData" embedded="false"/>

    I often read directly from Excel files (mostly if the data is spread across multiple sheets or isn't is a friendly row format) but it involes writting a .NET or Java program in which Ithe Excel file is read and then call the appropriate Clarity Web Services to load the data.

    V/r,

    Gene