What I'd like to know is if .txt files being imported into the vault have for instance "description" data in the contents of the .txt file, can that data be read by PDM Standard and mapped to a Data Card variable?
I have a large number of non-modeled items to check into the vault for use in SolidWorks BOM's using paste-as-reference. While testing this we've come up with a work flow that works pretty well. Essentially we output the SKU's from our ERP system to a spreadsheet; run a powershell command that takes that spreadsheet as an input and outputs newly created .txt files for each SKU in the spreadsheet; we then take the newly created .txt files and check them into the vault mapping the file name less the extension to the "number" variable in our .TXT Data Card. New Data Cards are correctly populating with the SKU's of all the items we bring in from our ERP this way, and at a minimum this is working. I'm just wondering if I can do something similar with the contents of the file, not just mapping the name of the file. Thanks for the help.
SolidworksAdministration
I think you will have to look at upgrading your "powershell" routine to output a different file type (XML? .doc?) because I am pretty sure .txt files do not have "custom properties".
alternately, a macro may be able to parse out the data from the .txt files...
Thanks, I was assuming this might be the case.
I actually did some looking into that earlier. I think it would work but injecting the desired meta data into the file attributes / properties is the tricky thing. From what I read it looks like you would have to somehow call an application that creates those files natively to write the info to the file properties. Such as, a image editor to write to the properties of a .jpg or calling (vb script possibly) MS Excel to modify the properites of a .xlsx file. Either way, I'll stick with what we've got, we at least get the correct SKU / Part Numbers coming in this way.
If anyone's interested in the powershell command we're using to turn a single spreadsheet into multiple new .TXT files all named according to cells in the spreadsheet, this is what we're using...
PS> Import-Csv "yourFile.csv" | Add-Content
So long as your CSV file has column headers of "path" and "itemtype" with the destination path + desired filename in the "path" column and the string "file" in every cell of the "itemtype" column, the command will create as many .txt files as there are rows in your spreadsheet and name them according to whatever is in the "path" cell for that row. It's been a quick way for us to export hundreds of SKUs from our legacy ERP system and quickly populate our vault with .TXT file objects for each SKU.
Thanks again for the reply.