Solved

Prepare Retail Edge POS Import File in Excel

Posted on 2011-02-24
3
537 Views
Last Modified: 2012-05-11
Hi,

I need to create an import file for a POS system (RetailEdge) in order to import all inventory items to the POS software. I have all inventory items in an Excel spreadsheet, all the required information is separated by columns and in (1) line for example:

Inv_Sku, Inv_Desc, Inv_ItemID, Loc_settings_LocID,.........

But the problem is that the format required by Retail Edge to import inventory items is the following:

<REDI_Invent>
Inv_Sku,Inv_Desc,Inv_ItemID,Loc_Settings_LocID,Inv_Quan,Inv_DepartID,Inv_VendorID,Inv_ClassID,Inv_Cost_Last,Inv_Cost_Avg,Inv_Part_Mfr,Inv_Part_Vendor,Inv_StockType,Inv_UPC1,Inv_UPC2,Inv_ExpCode,Inv_Weight,Inv_User1,Inv_User2,Inv_User3,Inv_User4,Inv_User5,Inv_MatrixID,Inv_Matrix_D1,Inv_Matrix_D2,Inv_Matrix_Parent,Inv_AddOns,Inv_Aliases,Inv_AutoScale,Inv_Case_Parent,Inv_Case_Count,Inv_Loc_Taxable,Inv_Loc_Price_Was,Inv_Loc_Price1,Inv_Loc_Price2,Inv_Loc_Price3,Inv_Loc_Price4,Inv_Loc_Price5,Inv_Loc_Min1,Inv_Loc_Min2,Inv_Loc_Min3,Inv_Loc_Min4,Inv_Loc_Max1,Inv_Loc_Max2,Inv_Loc_Max3,Inv_Loc_Max4,Inv_Loc_BinShelf
1001,"Sony TV 32"" TEST ITEM",843712,MainStore,0,ELECTRONICS,VENDOR,~~Unassigned~~,2.99,0.00,,,Stock,12121212121565212,,,,,,,,,~~Unassigned~~,,,,,,False,,0,True,5.99,5.99,5.99,5.99,5.99,5.99,0,0,0,0,0,0,0,0,</REDI_Invent>
<REDI_Depart>
Dept_DepartID,Dept_Desc,Dept_Margin
ELECTRONICS,ELECTRONICS,50</REDI_Depart>
<REDI_Vendor>
Vend_VendorID,Vend_Desc,Vend_Contact,Vend_AccountNum,Vend_Street1,Vend_Street2,Vend_City,Vend_State,Vend_PostalCode,Vend_Country,Vend_Phone,Vend_Fax,Vend_EMail
VENDOR,Vendor,,,,,,,,,,,</REDI_Vendor>

NOTE: The bold letters mean the information from (1) record or inventory item, the other words are the heading or field names.


The example above is only the information of (1) item, imagine if I have to import 2,000 inventory items. I know that should exist a way to extract the information that I have on the table and convert it to this format. I need a simple example of how to do it in Excel, Access or Visual Basic in order for me to get an idea.


If you have any questions please just let me know.

Thanks in advance for any comments.

Regards,
0
Comment
Question by:mmoralespr
  • 2
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 34976971
Hi, without a sample xls file, and a sample output file, I have created this script which might do the job for you.

Specify your XLS file, and the name you want for the output file, and it should open the XLS file, read the rows (from row 2), and create the import data.

Regards,

Rob.
strExcelFile = "Inventory.xls"
strImportFile = "ImportData.txt"

Const xlUp = -4162
Set objExcel = CreateObject("Excel.Application")
Set objWB = objExcel.Workbooks.Open(strExcelFile, False, False)
objExcel.Visible = True
Set objSheet = objWB.Sheets(1)

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objOutput = objFSO.CreateTextFile(strImportFile, True)

For intRow = 2 To objSheet.Cells(65536, "A").End(xlUp).Row
	strRecord = "<REDI_Invent>" & VbCrLf & _
		"Inv_Sku,Inv_Desc,Inv_ItemID,Loc_Settings_LocID,Inv_Quan,Inv_DepartID,Inv_VendorID,Inv_ClassID,Inv_Cost_Last,Inv_Cost_Avg,Inv_Part_Mfr,Inv_Part_Vendor,Inv_StockType,Inv_UPC1,Inv_UPC2,Inv_ExpCode,Inv_Weight,Inv_User1,Inv_User2,Inv_User3,Inv_User4,Inv_User5,Inv_MatrixID,Inv_Matrix_D1,Inv_Matrix_D2,Inv_Matrix_Parent,Inv_AddOns,Inv_Aliases,Inv_AutoScale,Inv_Case_Parent,Inv_Case_Count,Inv_Loc_Taxable,Inv_Loc_Price_Was,Inv_Loc_Price1,Inv_Loc_Price2,Inv_Loc_Price3,Inv_Loc_Price4,Inv_Loc_Price5,Inv_Loc_Min1,Inv_Loc_Min2,Inv_Loc_Min3,Inv_Loc_Min4,Inv_Loc_Max1,Inv_Loc_Max2,Inv_Loc_Max3,Inv_Loc_Max4,Inv_Loc_BinShelf" & VbCrLf
	For intCol = 1 To 47
		strRecord = strRecord & objSheet.Cells(intRow, intCol).Value & ","
	Next
	strRecord = strRecord & "</REDI_Invent>" & VbCrLf & _
		"<REDI_Depart>" & VbCrLf & _
		"Dept_DepartID,Dept_Desc,Dept_Margin" & VbCrLf
	For intCol = 48 To 51
		strRecord = strRecord & objSheet.Cells(intRow, intCol).Value & ","
	Next
	strRecord = strRecord & "</REDI_Depart>" & VbCrLf & _
		"<REDI_Vendor>" & VbCrLf & _
		"Vend_VendorID,Vend_Desc,Vend_Contact,Vend_AccountNum,Vend_Street1,Vend_Street2,Vend_City,Vend_State,Vend_PostalCode,Vend_Country,Vend_Phone,Vend_Fax,Vend_EMail" & VbCrLf
	For intCol = 52 To 64
		strRecord = strRecord & objSheet.Cells(intRow, intCol).Value & ","
	Next
	strRecord = strRecord & "</REDI_Vendor>"
	
	objOutput.WriteLine strRecord
Next

objOutput.Close

objWB.Close False
objExcel.Quit

MsgBox "Done. Please see " & strImportFile

Open in new window

0
 

Author Closing Comment

by:mmoralespr
ID: 34978895
Ohh men, you are amazing, It worked. I love Expert Exchange for this type of things.

I cant believe it. hehehehe!

Thanks Rob.  Take Care!

Michael
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 34983843
No problem.  Please make sure the exact number of fields are in the output file.  I got confused with all the commas in your example....

Thanks for the grade.

Regards,

Rob.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now