Filter löschen
Filter löschen

Reading csv file with varying names

4 Ansichten (letzte 30 Tage)
William Gray
William Gray am 31 Okt. 2019
Kommentiert: Stephen23 am 31 Okt. 2019
Hi everyone,
So I am tryig to read a large set of .csv files that contain some data sets. The issue is with the naming of the files. The person who recorded the data has unfourtunately added lots of little comments to the end of each file, but the begining of each file name is systematic. For example:
20190120_P1_Scan_23.24
20190120_P2_Scan_23.01
20190120_P3_Scan_22.61
There are lots of files named as above, where the end of the file name has no structure. I am comfortable creating a for loop, I think, to read the files if there was a pattern to the names but I'm unsure with this random nature. Is there a way to read files that just detect the begining of the name? For example, as long as the file starts with 20190120_P1... then it will be read?
There's hundereds of files so this would save a lot of renaming time!
Thanks for any help
  1 Kommentar
Stephen23
Stephen23 am 31 Okt. 2019
Why not just use dir? With dir you can specify literal characters (e.g. perhaps the underlines) and wildcard characters (e.g. the "random" parts, dates, etc.).

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Workspace Variables and MAT-Files finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by