Awk file rename script


















My bad. I should have checked the input :- — Warwick. No worries user If it works, please accept. Srini Srini 3 3 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.

Related 8. Hot Network Questions. Question feed. It only takes a minute to sign up. Connect and share knowledge within a single location that is structured and easy to search.

So far I was only reading, but now I have to start with a complicated question. Thank you for the ideas like Perl, not an option unfortunately. There are two problems with this: 1. I would need to have the names assigned from an another file called Company. It is possible to have a second step which finds the filename by key and does the merger deleting the old files, but it would be more elegant to do in first step "simply" replacing the target file name from the second file.

So the split must be based on the value from column 11 of the original file s and the filename on the second file. There can be more source files, they must append, and the split files may contain more than one of the key fields depending on the filename assignment.

Create and edit the script file in your parent directory by running the following command in the terminal cd to the directory first :. Ubuntu Community Ask! Sign up to join this community. The best answers are voted up and rise to the top.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Bash script to split file by its content renaming the split files from an another file Ask Question. Asked 2 years ago. Active 2 years ago. Viewed 2k times. A little code the part I am unable to do are only pseudo, but can't test the rest either :!

See the faq — tgkprog. Add a comment. Active Oldest Votes. This script will do that trick for you:! Jacek Sokolowski Jacek Sokolowski 4 4 silver badges 11 11 bronze badges. Thanks tgkprog - I have changed the code to prevent that.

Here's a pure bash way of doing it without bc, rename or sed. Conner Conner Hongbo Liu Hongbo Liu 2, 1 1 gold badge 23 23 silver badges 16 16 bronze badges. This can help:! Sign up or log in Sign up using Google.

Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.



0コメント

  • 1000 / 1000