I imported several thousand xls files to data.frame and I added a column with the file name.
So I have data
data1 data2 data3 filname
A A2 A3 301fg.xls
B B2 B3 302gfg.xls
C C2 C3 303gfsddf.xls
.,.,.,.
I want to rename the names in the file name column to contain only the first 3 characters / digits, which gives:
data1 data2 data3 filname
A A2 A3 301
B B2 B3 302
C C2 C3 303
.,.,.,.
source
share