For our work we use several scripts to gather/combine data for use in our webshop. Untill now we did not had any problems but since a couple days we noticed some mismatches between imports.
It happened that several barcodes where matched even though it was a complete other product. Of course the scripts arent checking on this yet so we need to upgrade the scripts to check for this and give us a list to check or update the listing.
The supplier sends us a CSV file with data as shown below:
supplier_clean.csv
This file is being joined to another file with the following code, more on this here:
joining.sh
This script get called as follows.
The website_clean has the following data (short example)
website_clean.csv
The problem is that the checking if the manufacturer has to happen during the joining together and to make matters worse some suppliers have different names for some suppliers (For example HP, Hewlet packard etc etc).
My idea is to have another file where first the website_clean checks for all the possible names of that manufacturer (see below for example) and this then compares against the supplier_clean csv. If the correct name is in there it continues as normal and if not it writes this line to a seperate file which we then can manual check for the names. In this seperate file i need both lines though so we can check which would be the correct name/product.
manufacturer_check.csv
I hope this is clear in what needs to happen to make it work. If not let me know and i will try to explain it better.
I need a little help as I am a complete novice at scripting in unix. However, i am posed with an issue... i have two csv files in the following format@
FILE1.CSV:
HEADER
HEADER
Header
, , HEADER
001X ,,200
002X ,,300
003X ,,300
004X ,,300
FILE2.CSV:
HEADER
HEADER
Header
, ,... (3 Replies)
I need a script (perl or awk..anything is fine) to join 3 files based on three key columns. The no of non-key columns can vary in each file. The columns are delimited by semicolon.
For example,
File1
Dim1;Dim2;Dim3;Fact1;Fact2;Fact3;Fact4;Fact5
---- data delimited by semicolon ---
... (1 Reply)
Hello, I know how to join multiple files using the cat function. I want to do something a little more advanced. Basically I want to put the filename in the first column...
One thing to note is that the file is tab delimited.
e.g.
file1.txt
joe 1 4 5 6 7 3
manny 2 3 4 5 6 7
... (4 Replies)
Hi guys,
I am a forum (and a bit of a unix) newbie, and I currently have a tricky problem lying ahead of me. I have multiple files, and I am looking to join the files on the first column.
Example:
File 1
andy b 100
amy c 200
amy d 300
File 2
andy c 200
amy c 100
clyde o 50
... (3 Replies)
I am trying to execute the following command to check the existance of a file (which has a date timestamp on it). If there are more than one file, then also it should give me 'success' result.
if
then
<do some work>
else
<no files>
fi
Since there are more than one... (18 Replies)
Hi! I need to learn that how a shell script can transverse a csv file n check if any field is empty or not. means its contains two comma or space b/w commas i.e., "" or " ".
can anyone help me out how I can do that.... (10 Replies)
Hi again,
I have monthly one-column files of roughly around 10 years. Is there a more efficient way to concatenate these files column-wise other than using paste command? For instance:
file1.txt
12
13
15
12
file2.txt
14
15
18
19
file3.txt
20
21 (8 Replies)
Hello again,
I am trying to join 3rd column of 3 files into the end on one file and save it separately... my data looks like this
file 1
Bob, Green, 80
Mark, Brown, 70
Tina, Smith, 60
file 2
Bob, Green, 70
Mark, Brown, 60
Tina, Smith, 50
file 3
Bob, Green, 50
Mark, Brown,60
Tina,... (6 Replies)
Hello All,
just wanted to export multiple tables from oracle sql using unix shell script to csv file and the below code is exporting only the first table.
Can you please suggest why? or any better idea?
export FILE="/abc/autom/file/geo_JOB.csv"
Export= `sqlplus -s dev01/password@dEV3... (16 Replies)