awk and rename ?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk and rename ?
# 1  
Old 04-23-2015
awk and rename ?

I have a log file from /m/n/o/A.log with 1 line
current content: 19518634,SW,windows_x86_64
and an folder from /x/y/z/testit_folder
How do you write a shell script to rename test_folder to changed_monthdate_19518634

If today is 04/23 the name should be changed_0423_19518634
Thanks for your help.
# 2  
Old 04-23-2015
Moderator's Comments:
Mod Comment This thread appears to be a duplicate of the thread Grep and rename ?.

Continue any discussion for this thread there.

This thread is closed.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to count and rename based on fields

In the below awk using the tab-delimited input, I am trying count the - symbol in $5 and output the count as well as the renamed condition ins. I am also count the - symbol in $6 and output the count as well as the renamed condition del. I am also count the tomes that in $5 and $6 there are... (6 Replies)
Discussion started by: cmccabe
6 Replies

2. Shell Programming and Scripting

awk : split file and rename and save in path according to content

Hello, I'm using Windows 7 ; sed, awk and gnuwin32 are installed. I have a big text file I need to manipulate. In short, I will have to split it in thousands of short files, then rename and save in a folder which name is based upon filename. Here is a snippet of my big input.txt file (this... (4 Replies)
Discussion started by: sellig
4 Replies

3. UNIX for Dummies Questions & Answers

awk - Rename output file, after processing, same as input file

I have one input file ABC.txt and one output DEF.txt. After the ABC is processed and created output, I want to rename ABC.txt to ABC.orig and DEF to ABC.txt. Currently when I am doing this, it does not process the input file as it cannot read and write to the same file. How can I achieve this? ... (12 Replies)
Discussion started by: High-T
12 Replies

4. UNIX for Dummies Questions & Answers

Using rename

I want to rename files Files show like this 1977SSD_rsdtst.pdf 1976SDP_rstdtsr.pdf 1943FDT_rstdsrt.pdf 1996DFF_stdstrd.pdf I want to introduce _ after the year, and move the characters to the end to get 1977_rsdtst_SSD.pdf 1976_rstdtsr_SDP.pdf 1943_rstdsrt_FDT.pdf... (4 Replies)
Discussion started by: kristinu
4 Replies

5. Shell Programming and Scripting

Combination awk and rename

Hello, i wondering if anybody can help me with the following: doing a search for the words "Sample ID:" in a file called test.txt and I need to have the string after this (Postmatch) Then I want that the string is used to rename an other file called test.pdf into .... the string.pdf I... (8 Replies)
Discussion started by: pcdok
8 Replies

6. Shell Programming and Scripting

Rename file using sed or awk

I have a filename like 1_DATE_3_4.5_888 and I want to modify the date field (ie the last 4 digits ) alone and remove the last field. Old filename:1_DATE_3_4.5_888 Given date (for eg):120606259532 modified date:120606259899 new filename:1_<modified date>_3.4.5 (14 Replies)
Discussion started by: sandy88
14 Replies

7. UNIX for Dummies Questions & Answers

Sed or Awk usage to rename string

I have gotten myself totally lost trying to sort this out and just need some help please.. I will have a multiple directories using the following naming convention with an undetermined number of files in each directory. 9780743582094_05of5_Accountable.wav I need to batch rename all files... (5 Replies)
Discussion started by: glev2005
5 Replies

8. Shell Programming and Scripting

awk split and rename files

I have a file test1.html like below: <dctm_topnav_en_US> <html> ..... </html> <dctm_topnav_en_CA> <html> ..... </html> <dctm_topnav_en_FR> <html> ..... </html> I need to use awk to split this into three file names like en_US.html , en_CA.html, en_FR.html each having content between... (4 Replies)
Discussion started by: vijay52
4 Replies

9. Shell Programming and Scripting

rename

hi, im doin an assignment which requires you to build a shell script to do the MS DOS style equivilant (sp?) of the rename function. What i have to do is a loop which checks the following rules and output messages (same): Can't have anything after target Can't have more than one dot Can't... (1 Reply)
Discussion started by: bohoo
1 Replies

10. UNIX for Dummies Questions & Answers

how can I rename the following=-^

I have a file named -^, I want to look at it, rename, etc. Any help out there?? (5 Replies)
Discussion started by: nj78
5 Replies
Login or Register to Ask a Question