![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| using Grep for only a certain number of columns | MaestroRage | UNIX for Dummies Questions & Answers | 2 | 02-13-2008 02:24 AM |
| How to grep a number in a file to find them in another file | ahjiefreak | Shell Programming and Scripting | 7 | 12-12-2007 06:01 AM |
| Grep a number from a line in ksh | rodluo | Shell Programming and Scripting | 3 | 12-09-2007 09:31 AM |
| Finding number ranges using grep | DKNUCKLES | Shell Programming and Scripting | 2 | 11-07-2007 02:30 AM |
| Rename a number of files using grep | TylerDurden | UNIX for Dummies Questions & Answers | 4 | 11-24-2003 03:12 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to grep a number in a file name
Hi,
I have multiple files where it starts with test1.c, test2.c,test3.c and so on. I would like to get each file separately to perform abstraction from these files. I tried something like:- for t in ./* filenumber=${t:4} # to cut the "test" in order to get the number cat test$filenumber.c| sed 's/^[ ]*//' >final.txt However, in my folder, there is other potential file other than test1.c,test2.c...in other words, there are other files in the folder. Is there other better way to grab the number so that each file can be catenate automatically? Please advise. Thanks. -Jason |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|