Sage 100

 View Only
  • 1.  Importing quotes (") into the item code field

    Posted 05-31-2024 14:31
    Edited by Jeff Schwenk 05-31-2024 14:35

    EDITED     NEVERMIND!!!!!!!!!  IT APPEARS THAT EXCEL IS THE PROBLEM!!!!

    Setting up new new company's item master.  They provided a 256K item master that contains quotes (") in the item code.  Sage sees this and adds a second quote so that you now have "" instead of ".  I stopped at a test import of 100 lines.

    Is there a way around this?  It went something like replacing all " with a |, then writing some type of formula to replace the | with the " which somehow gets past the Sage "".  Am I remembering correctly?  IF so, will you please share the way forward?

    Thanks in advance.

    Happy weekend.



    ------------------------------
    Jeff Schwenk
    Bottomline Software, Inc.
    (540) 221-4444
    ------------------------------



  • 2.  RE: Importing quotes (") into the item code field

    Posted 05-31-2024 14:40

    I assume you have strongly tried to discourage them from using special characters in the ItemCode field?  It causes all kinds of problems that are best avoided entirely.

    Technically, here are some notes related to importing CRLF, where you'd just use chr(34) instead of chr(13)+chr(10)... and your temp field(s) need to be Key Assigns Only for importing ItemCode values into CI_Item.

    (Last line below is a "calculation" for use in VI).



    ------------------------------
    Kevin Moyes
    Technical Systems Analyst
    Munjal White Consulting Co.
    Toronto ON
    ------------------------------



  • 3.  RE: Importing quotes (") into the item code field

    Posted 06-03-2024 11:23
      |   view attached

    I do the Replace with a symbol, then in the VI job do the following:

    1. Create a Temp field and import the value
    2. Create a formula:
      SUB(Temp1$,$24$,$22$)

    Where Temp1$ is the Temp field from Step 1, $24$ is the ASCII reference for the symbol in your file, and $22$ is the ASCII reference for quotes.  Attached is the ASCII chart showing the references.



    ------------------------------
    Susan Pawlowic
    Sage 100 Solutions Architect
    RKL eSolutions, LLC
    spawlowic@rklesolutions.com
    (717) 735-9109 Ext. 4352
    ------------------------------

    Attachment(s)

    xlsx
    ASCII Table.xlsx   15 KB 1 version


  • 4.  RE: Importing quotes (") into the item code field

    Posted 06-04-2024 11:15

    Epilogue - I imported the Excel data into Access and then exported the table to a tab-delimited file.  Access provided options (that Excel doesn't) to avoid the double quote issue.  Imported all but five records.  Only four had quotes in the item code field.  Moving forward.



    ------------------------------
    Jeff Schwenk
    Bottomline Software, Inc.
    (540) 221-4444
    ------------------------------



  • 5.  RE: Importing quotes (") into the item code field

    Posted 06-06-2024 09:38
    Edited by David Speck II 06-06-2024 09:39

    Excel will try to escape a double quote with another double quote when you save it as csv or tab delimited.  VI does not parse escaped double quotes correctly so it sees it has two double quotes.  You can solve this by using a calculation on the field you are trying to import and using the SUB function.  If the field you are trying to import is part of a key, then you should use a temp field using the Replace operation with the proper assignment selection (Key, Header, Line) so VI knows when it changes so it can save the record and start the next record.  The any of the following SUB function examples will work to replace two double quotes with a single double quote.  You can use the CHR() function to specify a ASCII code or use the shorthand version Susan mentioned which is enclosing the ASCII code in $.  When using IMP$[x], the x represents the column (1 - 99, it is an array that is not zero-based) in the source file you want to use in the calculation.

    SUB(IMP$[x], QUO + QUO, QUO)
    SUB(IMP$[x], """""", """")
    SUB(Temp001$, CHR(34) + CHR(34), CHR(34))
    SUB(Temp001$, $34$ + $34$, $34$)

    Also, as Kevin mentioned, it is best to avoid double quotes whenever possible, especially in key fields.



    ------------------------------
    David Speck II
    Blytheco LLC
    ------------------------------



  • 6.  RE: Importing quotes (") into the item code field

    Posted 06-06-2024 10:51

    Thank you all for the very interesting responses.  Given my current programming skill level, I will rely on my memory to use Access to export to a CSV file.  Thought I must say, I could write some mean Lotus macros back in the day! 



    ------------------------------
    Jeff Schwenk
    Bottomline Software, Inc.
    (540) 221-4444
    ------------------------------