フィルターのクリア

How to Sort following table data in excel containing multiple column ?

2 ビュー (過去 30 日間)
Nimisha
Nimisha 2018 年 11 月 15 日
回答済み: Peter Perkins 2018 年 11 月 15 日
I have table as below and i want to sort as expected output as below. How to perform using MATLAB. Table is inside Excel/csv format. ?
Column1 Column2 Column3 Column4
ABC DEF 12 DGMN
PQR MNO 17 DGSD
DEF JPG United DGFS
JPG PQR 21Hi DFPR
SQL STF STM DGBC
PQR YZW Hello90 DGSF
MNO ABC DQT DGCV
STF SQL A18B DGFD
I want to Match column1 data with Column2 data and want to add new 2 columns(5&6) with sorted data as below.
Column1 Column2 Column3 Column4 Column5 Column6
ABC DEF 12 DGMN DQT DGCV
PQR MNO 17 DGSD 21Hi DFPR
DEF JPG United DGFS 12 DGMN
JPG PQR 21Hi DFPR United DGFS
SQL STF STM DGBC A18B DGFD
PQR YZW Hello90 DGSF 21Hi DFPR
MNO ABC DQT DGCV 17 DGSD
STF SQL A18B DGFD STM DGBC
I know only to read excel as xlsread and scan data...

回答 (2 件)

madhan ravi
madhan ravi 2018 年 11 月 15 日
use readtable()
  1 件のコメント
Nimisha
Nimisha 2018 年 11 月 15 日
I have completed reading operation using xlsread.
Readtable is similar. '
Next thing to do is Compare first column with second column, and if matches then sort rows as shown.!!

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


Peter Perkins
Peter Perkins 2018 年 11 月 15 日
This sounds like a join, but for some reason you have everything in one table.
I'm guessing you can use ismember on the two leading table variables, and get the row numbers as the second output.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by