![]() |
|
|
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 |
| Rename file based on first 3 characters of data in file | jchappel | UNIX for Dummies Questions & Answers | 3 | 10-01-2008 03:21 PM |
| How to read and write directory or file contents in c++ ? | namrata5 | High Level Programming | 3 | 09-28-2007 04:58 PM |
| read contents of a line | sethunath | UNIX for Dummies Questions & Answers | 2 | 06-28-2007 01:51 PM |
| Creating file contents using contents of another file | ReV | Shell Programming and Scripting | 21 | 02-24-2006 10:25 AM |
| Help with multiple file rename - change case of part of file name | steve7 | UNIX for Dummies Questions & Answers | 7 | 06-30-2005 02:41 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Read File and use contents to rename another
Hello guys, thank God that I found this forum.
I hope that someone can help me because I don't have any idea on how to start it. I know that for some of you this is a very simple task but I'm not as advance on shell scripting like many people out there. I got this file with a permanent filename (RSA_RECORDS.txt) that the content always starts like this. Code:
# ISSUER CODE: QPPS # FROM DATE: 20090224 # TO DATE: 00000000 # SEQUENCE NUMBER: 001 # RECORD COUNT: 0000000003 # NUMBER OF FIELDS: 015 # DELIMITER: ; BLABLABABLABLABLA BLABLABABLABLABLA BLABLABABLABLABLA QPPS_20090224_00000000_01.txt As you can notice the name is created by using those first four lines of the file. <ISSUER CODE>_<FROM DATE>_<TO DATE>_<SEQUENCE NUMBER>.txt The only issue here is that the main file changes everyday and that is the reason that I need a shell script that can dynamically create a copy of that main file with an specific name. On my Unix server I can see that I have awk and sed support. No perl, python, ruby, etc. Thanks for your help guys Last edited by Shark Tek; 02-25-2009 at 01:23 PM.. |
| Bookmarks |
| Tags |
| unix filename script rename |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|