Difference between revisions of "Shop Import / Export Scripts"

From GLMWiki
Jump to: navigation, search
(Created page with " == Coffman Case Knives - old shop export into csv == psql -U nobody -d coffmancaseknives -h ds4 -c "copy (select p.prod_id as "Product ID", p.prod_name as "Product Name", re...")
 
(Coffman Case Knives - old shop export into csv)
Line 2: Line 2:
  
 
== Coffman Case Knives - old shop export into csv ==
 
== Coffman Case Knives - old shop export into csv ==
psql -U nobody -d coffmancaseknives -h ds4 -c "copy (select p.prod_id as "Product ID", p.prod_name as "Product Name", regexp_replace(p.prod_desc, E'^M|\r|\n', '
+
psql -U nobody -d coffmancaseknives -h ds4 -c "copy (select p.prod_id as \"Product ID\", p.prod_name as \"Product Name\", regexp_replace(p.prod_desc, E'\^M|\r|\n', '<br>', 'g') as \"Product Description\", regexp_replace(i.item_desc, E'\^M|\r|\n', '<br>', 'g') as \"Line-Item Name\", i.item_price as \"Line-Item Price\", 'http://www.coffmancaseknives.com/shop/shop_images/original/' || p.prod_img as \"Product Image\" from product p LEFT OUTER JOIN item i on (p.prod_id = i.prod_id) ORDER BY p.prod_id ASC) to STDOUT csv header" > ~/coffmancaseknives-products.csv
', 'g') as "Product Description", p.prod_img as "Product Image", regexp_replace(i.item_desc, E'^M|\r|\n', '
+
', 'g') as "Line-Item Name", i.item_price as "Line-Item Price", i.item_img as "Line-Item Image" from product p LEFT OUTER JOIN item i on (p.prod_id = i.prod_id) ORDER BY p.prod_id ASC) to STDOUT csv header" > ~/coffmancaseknives-products.csv
+

Revision as of 15:35, 20 April 2016


Coffman Case Knives - old shop export into csv

psql -U nobody -d coffmancaseknives -h ds4 -c "copy (select p.prod_id as \"Product ID\", p.prod_name as \"Product Name\", regexp_replace(p.prod_desc, E'\^M|\r|\n', '
', 'g') as \"Product Description\", regexp_replace(i.item_desc, E'\^M|\r|\n', '
', 'g') as \"Line-Item Name\", i.item_price as \"Line-Item Price\", 'http://www.coffmancaseknives.com/shop/shop_images/original/' || p.prod_img as \"Product Image\" from product p LEFT OUTER JOIN item i on (p.prod_id = i.prod_id) ORDER BY p.prod_id ASC) to STDOUT csv header" > ~/coffmancaseknives-products.csv