フィルターのクリア

Find addresses from one file in another file then save into a third file

1 回表示 (過去 30 日間)
I'm trying to make a code that takes in a file of addresses (fileA), searches for that address in another file (fileB), then saves that line of data into another file (outputFile).
It runs fine but there's no data in the outputFile. I think the problem I'm running into is the data within the tables. I've tried a few different file formats (.csv, .xls, etc.) and sometimes the addresses show up as NAN and sometimes they show up with too many quotes around them (like this: ""address""). Is there a better way I can be formatting these? Any tips on the code? Thanks!
  2 件のコメント
Stephen23
Stephen23 2023 年 12 月 7 日
編集済み: Stephen23 2023 年 12 月 7 日
"Any tips on the code?"
Replace the FOR-loop with ISMEMBER. Read its documentation carefully: ISMEMBER has multiple outputs.
Pay attention to the orange underlining: expanding arrays inside loops is inefficient.
BianH
BianH 2023 年 12 月 8 日
The addresses tabulated, thank you for the advice!

サインインしてコメントする。

採用された回答

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 12 月 6 日
(1) That would be helpful to see your sample data file.
(2) You can also try contains() fcn as well, e.g.:
Match_Row = contains(TableB.Address, currentAddress, IgnoreCase=true);
  2 件のコメント
BianH
BianH 2023 年 12 月 8 日
I messed around with it a bit more and I think the "contains" function is what did it. The addresses are tabulating now.
Thank you so much!
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 12 月 8 日
Most welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by