Prepare Retail Edge POS Import File in Excel

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,
mmoralesprAsked:
Who is Participating?
 
RobSampsonConnect With a Mentor Commented:
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
 
mmoralesprAuthor Commented:
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
 
RobSampsonCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.