Hello, I have a two tab delimited txt file's that I need converted to another tab delimited file but with the record names changed and some field processing done. Also 3 Static fields will be added to each record.
The source file has a tab delimited header, the destination will also have a tab delimited header but the order and names of the fields will be different.
Source Field = Destination Field
---------------------------------
item_no in source file = moved to 'v_products_model' in destination file.
restricted = Don't Import record if = "X"
burst = define as variable $BURST (will be used later)
msrp = Ignore Not needed in destination file.
map_price = 'v_products_map'
price_note = Ignore Not needed in destination file.
brand = 'v_manufacturers_name'
brand_logo = Ignore Not needed in destination file.
segment ='v_categories_name_1'
category = 'v_categories_name_2'
content_group = 'v_categories_name_3'
headline = 'v_products_name_1' . $BURST
packing_slip_desc = $packing_slip_desc
bullet_points = $bullet_points
mfg_url = Ignore Not needed in destination file.
upc_code = $upc_code
length = Ignore Not needed in destination file.
width = Ignore Not needed in destination file.
height = Ignore Not needed in destination file.
weight = 'v_products_weight'
main_image = 'v_products_image'
addl_image1 = 'v_products_subimage1'
addl_image2 = 'v_products_subimage2'
addl_image3 = 'v_products_subimage3'
addl_image4 = 'v_products_subimage4'
addl_image5 = 'v_products_subimage5'
addl_image6 = 'v_products_subimage6'
addl_image7 = Ignore Not needed in destination file.
addl_image8 = Ignore Not needed in destination file.
addl_image9 = Ignore Not needed in destination file.
addl_image10 = Ignore Not needed in destination file.
One of the fields needs to be generated from some of the above information and put into 'v_products_description_1' in the destination file. The PHP code should look something like this.
'v_products_description_1' = $packing_slip_desc . '<BR>' . $BURST . '<BR>' . 'Manufacturer UPC Code:' . $upc_code . '<BR><BR>' . $bullet_points ;
the 3 static fields that need to be added are.
'v_tax_class_title','v_status','EOREOR']
they should be defined as
'v_tax_class_title' = "Taxable Item"
'v_status' = "Active"
'EOREOR' = "EOREOR"
The file tab delimited file should have a header and records to follow that look like this.
v_products_model v_products_map v_manufacturers_name v_categories_name_1 v_categories_name_2 v_categories_name_3 v_products_weight v_products_image v_products_subimage1 v_products_subimage2 v_products_subimage3 v_products_subimage4 v_products_subimage5 v_products_subimage6 v_products_name_1 v_products_description_1
THE SECOND FILE.
----------------
Another tab delimited file will also need to be converted. This one is EASY.
item_no = 'v_products_model'
price = 'v_products_price' = (price * 1.10)
qty_available = 'v_products_qty'
qty_bo = Ignore Not needed in destination file.
qty_in_transit = Ignore Not needed in destination file.
and again 3 fields need to be added.
'v_tax_class_title' = "Taxable Item"
'v_status' = "Active"
'EOREOR' = "EOREOR"
The final tab delimited file should have a header that looks like this.
v_products_model v_products_price v_products_qty v_tax_class_title v_status EOREOR
I can do it many different languages, even not listed in your choices (like shell, awk etc.). From your given choices I will prefer Perl.
Kindly refer to PMB for few queries.