I'm new here and I want to ask how to add sizes of files with the same name? My file names are actually different from each other but I cut them so I could get files that are grouped together.
here are my original files with sizes (sample)
sample.txt has this data inside:
- 12345 a_1.txt
- 12234 b_1.txt
- 32123 c_1.txt
- 11122 a_2.txt
Now I cut the filenames inside sample.txt to remove those characters starting from '_' (underscore). They become like this:
- 12345 a
- 12234 b
- 32123 c
- 11122 a
Now I want to add sizes of all files with same filename as seen above. Output should be like this:
- 23467 a
- 12234 b
- 32123 c
Please help. Thanks a lot guys. I'm stuck here for hours now
sample.txt
and you want them in the output. It looks like numbered list so maybe not. Please paste your file and desired output ascode sample
to avoid confusion.