I have some files such as:
abc.dat.xyz1234.001
abc.dat.xyz1234.002
abc.dat.xyz1234.003
and so on.
The files are pipe delimited as:
1|abc|hty|!
2|def|hju|!
and so on.
I would like to remove the first column value and the delimiter from all rows in the file. So the files need to look like this:
abc|hty|!
def|hju|!
I know I can do it using cut but I also need to rename the files as:
abc.dat.xyz1234.001 becomes abc.dat.00
abc.dat.xyz1234.002 becomes abc.dat.01
and so on.
Most important, the number of files is not fixed. The only difference between the file names is the last digit. Is there a simple way to do this?
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.