我的C#WPF应用程序以这种方式动态填充给定目录中的1000s文件中的100s of listView1:
import pandas as pd
df = pd.read_csv("<Your-CSV-file>", columns=["id", "name", "longitude", "latitude"])
df.drop(columns=["id"]) ## this will drop the column named id
df.to_csv("<Your-New-CSV-file-Path>", index=None, header=True)
我想根据它们的公共路径将所有文件动态分组在一起。
这是我尝试过的-
File Name | Path | Size
ABC.docx | C:\Mike | 30 KB
OPQ.rar | E:\Tims \ 10 MB
CDE.jpg | D:\Jobs | 15 KB
XYZ.png | C:\Mike | 10 KB
GHI.tmp | D:\Jobs | 2 KB
预期输出-
public class filesList
{
public string File {get;set;}
public string Path {get;set;}
public long Size {get;set;}
}
CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(listView1.ItemsSource);
PropertyGroupDescription groupDescription = new PropertyGroupDescription("Path");
view.GroupDescriptions.Add(groupDescription);