Join two files based on bakery code
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have two files I would like to join based on the bakery store number.
[File 1] bakedGoods.txt
1:Chocolate Cookies:111
2:Banana Muffins:222
3:Apple Pie:333
4:Strawberry Cheesecake:444
5:Pineapple Turnover:555
Where column 1 is the number of the item, column 2 is the item name, and column 3 is the store number.
[File 2] bakeryStores.txt
111:Cookies Cookies Cookies
222:Bellas Desserts Co.
333:Apples N' Sweets
444:Cheesecake Emporium
777:Estrellas Bakery
888:Suzy's Baked Goods
Where column 1 is the bakery store number and column 2 is the name of the bakery.
My goal is to join the information that has the same bakery store number by using the join command (I assume that is the best way). This means column 3 for file 1 and column 1 for file 2. As well as display a message "Not in store" for the empty fields that are not pair-able. (Which I assume using the option -e"Not in store" is the best way to go. The below is what I am trying to achieve.
111:Chocolate Cookies:Cookies Cookies Cookies
222:Banana Muffins:Bellas Desserts Co.
333:Apple Pie:Apples N' Sweets
444:Strawberry Cheesecake:Cheesecake Emporium
Not in store
Not in store
I try to join the two files by store number, using the -e option, but nothing changes. I see no output either.
linux bash join
add a comment |Â
up vote
0
down vote
favorite
I have two files I would like to join based on the bakery store number.
[File 1] bakedGoods.txt
1:Chocolate Cookies:111
2:Banana Muffins:222
3:Apple Pie:333
4:Strawberry Cheesecake:444
5:Pineapple Turnover:555
Where column 1 is the number of the item, column 2 is the item name, and column 3 is the store number.
[File 2] bakeryStores.txt
111:Cookies Cookies Cookies
222:Bellas Desserts Co.
333:Apples N' Sweets
444:Cheesecake Emporium
777:Estrellas Bakery
888:Suzy's Baked Goods
Where column 1 is the bakery store number and column 2 is the name of the bakery.
My goal is to join the information that has the same bakery store number by using the join command (I assume that is the best way). This means column 3 for file 1 and column 1 for file 2. As well as display a message "Not in store" for the empty fields that are not pair-able. (Which I assume using the option -e"Not in store" is the best way to go. The below is what I am trying to achieve.
111:Chocolate Cookies:Cookies Cookies Cookies
222:Banana Muffins:Bellas Desserts Co.
333:Apple Pie:Apples N' Sweets
444:Strawberry Cheesecake:Cheesecake Emporium
Not in store
Not in store
I try to join the two files by store number, using the -e option, but nothing changes. I see no output either.
linux bash join
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have two files I would like to join based on the bakery store number.
[File 1] bakedGoods.txt
1:Chocolate Cookies:111
2:Banana Muffins:222
3:Apple Pie:333
4:Strawberry Cheesecake:444
5:Pineapple Turnover:555
Where column 1 is the number of the item, column 2 is the item name, and column 3 is the store number.
[File 2] bakeryStores.txt
111:Cookies Cookies Cookies
222:Bellas Desserts Co.
333:Apples N' Sweets
444:Cheesecake Emporium
777:Estrellas Bakery
888:Suzy's Baked Goods
Where column 1 is the bakery store number and column 2 is the name of the bakery.
My goal is to join the information that has the same bakery store number by using the join command (I assume that is the best way). This means column 3 for file 1 and column 1 for file 2. As well as display a message "Not in store" for the empty fields that are not pair-able. (Which I assume using the option -e"Not in store" is the best way to go. The below is what I am trying to achieve.
111:Chocolate Cookies:Cookies Cookies Cookies
222:Banana Muffins:Bellas Desserts Co.
333:Apple Pie:Apples N' Sweets
444:Strawberry Cheesecake:Cheesecake Emporium
Not in store
Not in store
I try to join the two files by store number, using the -e option, but nothing changes. I see no output either.
linux bash join
I have two files I would like to join based on the bakery store number.
[File 1] bakedGoods.txt
1:Chocolate Cookies:111
2:Banana Muffins:222
3:Apple Pie:333
4:Strawberry Cheesecake:444
5:Pineapple Turnover:555
Where column 1 is the number of the item, column 2 is the item name, and column 3 is the store number.
[File 2] bakeryStores.txt
111:Cookies Cookies Cookies
222:Bellas Desserts Co.
333:Apples N' Sweets
444:Cheesecake Emporium
777:Estrellas Bakery
888:Suzy's Baked Goods
Where column 1 is the bakery store number and column 2 is the name of the bakery.
My goal is to join the information that has the same bakery store number by using the join command (I assume that is the best way). This means column 3 for file 1 and column 1 for file 2. As well as display a message "Not in store" for the empty fields that are not pair-able. (Which I assume using the option -e"Not in store" is the best way to go. The below is what I am trying to achieve.
111:Chocolate Cookies:Cookies Cookies Cookies
222:Banana Muffins:Bellas Desserts Co.
333:Apple Pie:Apples N' Sweets
444:Strawberry Cheesecake:Cheesecake Emporium
Not in store
Not in store
I try to join the two files by store number, using the -e option, but nothing changes. I see no output either.
linux bash join
linux bash join
asked 1 min ago
Isabel Estrella Sanchez
11
11
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f477133%2fjoin-two-files-based-on-bakery-code%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password