Batch process selecting certain areas of multiple CSV files and merge into one file

3 views (last 30 days)
Hello,
I have 12 CSV files stored a folder ("D:\PFP_deidentified_processed\PFP701_cropped"); and files are named
[701L_9999444, 701L_9999555, 701L_88884444, 701L_88885555, 701L_99996666, 701L_888866666, 701R_9999444, 701R_9999555, 701R_88884444, 701R_88885555, 701R_99996666, 701R_888866666].
Each file contains one sheet of data with the same file name and each has fist row and column which are not needed.
Required data area for each file will be from B2 to E19 (4 columns and 18 rows).
So I might be able to use code like 701L_Onlynumber=csvread('701L_88884444.csv','701L_88884444','B2:E19); per each files but I would like to be able to do it faster by batch processing those.
Ultimately, I would like to combine all files in one single file name of (701.xlsx) so that the sheet contains the data of 4 columns and 216 rows.
Thank you in advance.

Answers (0)

Categories

Find more on Variables in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!