Hello Friends, I am completely new to unix. Joined forum today. I have a problem which may seem very simple to you all. I will really appreciate your help.
I have a file.
Quote:
intel,80,Q-8029881900,ok
amd,82,Q-8055347900,ok
acer,40,Q-8033246100,ok
dell,22,Q-8098763500,ok
hp,33,Q-8011126700,ok
Purpose: to update this file as new product comes in. (product means: acer,intel, amd, etc..)
CASE 1: New Product: acer,
41,Q-8033762700,ok
(you can consider this 4 fields seperated by comma as input arguments)
i.e. we have new product (acer41 instead 40) as below, then we need to add new line
output file should look like
Quote:
intel,80,Q-8029881900,ok
amd,82,Q-8055347900,ok
acer,40,Q-8033246100,ok
dell,22,Q-8098763500,ok
hp,33,Q-8011126700,ok
acer,41,Q-8033762700,ok
CASE 2: New Product: dell,22,Q-
8098763501,ok
i.e. we have same product (dell 22 but Q change from Q-8098763500 to Q-8098763501) as below,then we need to replace that line
output file should look like
Quote:
intel,80,Q-8029881900,ok
amd,82,Q-8055347900,ok
acer,41,Q-8033762700,ok
dell,22,Q-8098763501,ok
hp,33,Q-8011126700,ok
Brief: This 2 case should keep working. lines will keep getting added when new product is there. & if same product & Q change then line will be replaced.
I will be really thankful if someone helps as soon as poss.
