Automated .txt file into .csv file into predefined format

ankrups

Board Regular
Joined
Mar 14, 2006
Messages
124
Office Version
  1. 2021
Platform
  1. Windows
I have product file in .txt format containing product information such as SKU no, description, dimensions, barcode etc. Each week I need to amend the file into my inventory system which reads predefined .csv file upload. I need to create a macro OR an automated method where when I run macro which should copy the data from .txt file and input the data into .csv file to particular columns.

Can anyone help me on this, please?
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi
I would set up a translation file with two sheets. Sheet one, source, copy your text file into here. use text to columns to split it, assuming it's tab delimited etc.
sheet two, destination. set up formulas to pull data from sheet one into the columns in the order you need. copy the formulas down as many rows as you need.
Each update, drop your data in and save out sheet two as a csv file.....
 
Upvote 0
Thanks Ron. So do you want me to send you the sample file before you further.?
 
Upvote 0
sure, send a sample of your text file you receive and the csv output you need
 
Upvote 0
just paste a few rows of each, that will be fine. I can copy and paste from the message
 
Upvote 0
input file (TXT File sample Data)
Field Value Dynamic Supplies Code CI521GY Description Canon CLI521 Grey Ink Cart Reseller Price Ex GST 13.77 Manufacturer Name Canon Product Category description CON-INK Product Weight (kg) 0.035 Manufacturer OEM Code CLI521GY Printer Compatibility CANON PIXMA MP980,CANON PIXMA MP990 Cartridge Yield 1,370 pages Cartridge Type Grey m3 (L x W x H) - Not cubic weight 0.00032 Regionalisation Code CAN-INK-RE Length (m) 0.12 Width (m) 0.09 Height (m) 0.03 SOH Brisbane >25 SOH Melbourne >25 SOH Perth 18 SOH Adelaide 5 SOH Sydney >25 GTIN Barcode 4960999682044

my inventory system version (CSV File)
Item TypeProduct IDProduct NameProduct TypeProduct Code/SKUBin Picking NumberBrand NameOption SetOption Set AlignProduct DescriptionPriceCost PriceRetail PriceSale PriceFixed Shipping CostFree ShippingProduct WarrantyProduct WeightProduct WidthProduct HeightProduct DepthAllow Purchases?Product Visible?Product AvailabilityTrack InventoryCurrent Stock LevelLow Stock LevelCategoryProduct Image ID - 1Product Image File - 1Product UPC/EAN

Hope this helps.

 
Upvote 0
is that how you receive the data? does it have end of line chars or any other separators?
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top