Sponsored Content
Top Forums UNIX for Dummies Questions & Answers renaming file from text in a file Post 302316558 by isonic1 on Friday 15th of May 2009 11:46:46 AM
Old 05-15-2009
renaming file from text in a file

Hello all,

I've read a couple different posts on this subject but couldn't quite get what I'm trying to do to work. I have a file and the last line always ends with the text below (without the "s), except the number 294 will be different each time. I want to rename this file to the number that appears on that line. e.g. rename testfile to 294 (without an extension) . Any suggestions or help would be much appreciated! Thanks.


"Status against revision: 294"
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how can I bcp out a table into a text file including the header row in the text file

Hi All, I need to BCP out a table into a text file along with the table headers. Normal BCP out command only bulk copies the data, and not the headers. I am using the following command: bcp database1..table1 out file1.dat -c -t\| -b1000 -A8192 -Uuser -Ppassword -efile.dat.err Regards,... (0 Replies)
Discussion started by: shilpa_acc
0 Replies

2. Shell Programming and Scripting

Renaming a file use another file as a sequence calling a shl

have this shl that will FTP a file from the a directory in windows to UNIX, It get the name of the file stored in this variable $UpLoadFileName then put in the local directory LocalDir="${MPATH}/xxxxx/dat_files" that part seems to be working, but then I need to take that file and rename, I am using... (3 Replies)
Discussion started by: rechever
3 Replies

3. Shell Programming and Scripting

File renaming from list of names contained in another file

I have to rename a large number of files so that the name of each file corresponds to a code number that is given side by side in a list (textfile). The list contains in column A the filename of the actual files to be renamed and in column B the name (a client code, 9 digits) that has to be... (7 Replies)
Discussion started by: netfreighter
7 Replies

4. Shell Programming and Scripting

search text file in file if this file contains necessary text (awk,grep)

Hello friends! Help me pls to write correct awk and grep statements for my task: I have got files with name filename.txt It has such structure: Start of file FROM: address@domen.com (12...890) abc DATE: 11/23/2009 on Std SUBJECT: any subject End of file So, I must check, if this file... (4 Replies)
Discussion started by: candyme
4 Replies

5. Shell Programming and Scripting

Renaming a file and keep the extension of file as it is

Hi, I am trying to rename multiple filenames in a UNIX directory matching a specific condition. i=0 for file in `ls $filename` do echo "$file" #echo $i i=`expr $i + 1` mv $src_dir/${file} $src_dir/${file}_${i} done But this code renames the filenames and... (9 Replies)
Discussion started by: chetancrsp18
9 Replies

6. UNIX for Dummies Questions & Answers

Converting a text file with irregular spacing into a space delimited text file?

I have a text file with irregular spacing between values which makes it really difficult to manipulate. Is there an easy way to convert it into a space delimited text file so that all the spaces, double spaces, triple spaces, tabs between numbers are converted into spaces. The file looks like this:... (5 Replies)
Discussion started by: evelibertine
5 Replies

7. UNIX for Dummies Questions & Answers

Extracting lines from a text file based on another text file with line numbers

Hi, I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

8. Shell Programming and Scripting

Renaming file and check for the renamed file existence

Hi Am trying to move a file from one name to another When I do "ls" to check for the moved filename I can see the file but when I try the same with a script am unable.. I think am doing some pretty silly error.. please help.. toMove=`ls | grep -E "partition.+"` mv $toMove partition._org... (7 Replies)
Discussion started by: Priya Amaresh
7 Replies

9. Windows & DOS: Issues & Discussions

Renaming part of a text file ?

I have several files that are named like this "DotP_D14 - Verknüpfung" They all have the " - Verknüpfung" in common. I'd like to rename all of them to get rid of that last part. Is this possible with DOS on windows ? (1 Reply)
Discussion started by: pasc
1 Replies

10. Shell Programming and Scripting

Match text to lines in a file, iterate backwards until text or text substring matches, print to file

hi all, trying this using shell/bash with sed/awk/grep I have two files, one containing one column, the other containing multiple columns (comma delimited). file1.txt abc12345 def12345 ghi54321 ... file2.txt abc1,text1,texta abc,text2,textb def123,text3,textc gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
GUILT-PATCHBOMB(1)						   Guilt Manual 						GUILT-PATCHBOMB(1)

NAME
guilt-patchbomb - Email a series of commits interactively SYNOPSIS
guilt-patchbomb [-n] [-s] [--in-reply-to <msgid>] [--git] [--subject-prefix <prefix>] [<hash> | <since>..[<until>] | ..<until>] DESCRIPTION
Send a series of commits via email asking for To, CC and other information interactively. OPTIONS
-n Don't send -s Don't add additional repository committer sign-offs to the patch. This allows the sign-off chain to be fully expressed in the commit messages and not changed by the act of sending a patchbomb. --in-reply-to <msgid> Set the In-reply-to header to the specified message id. This allows the patches to be sent as replies to an arbitrary message. --git Generate a patch which uses all the features offered by the git diff format (e.g., rename and copy detection). --subject-prefix <prefix> Rather than using the standard [PATCH] prefix in the subject line, use [<prefix>] instead. <hash> Only the specified revision. <since>..[<until>] Revisions starting from <since> until <until>. The <since> revision it self is NOT included, while <until> is. If <until> is not specified, it is assumed to be HEAD. ..<until> All revisions until the <until> revision (inclusive). AUTHOR
Written by Josef "Jeff" Sipek <jeffpc@josefsipek.net[1]> DOCUMENTATION
Documentation by Brandon Philips <brandon@ifup.org[2]> GUILT
Part of the guilt(7) suite (Generated for Guilt v0.35) NOTES
1. jeffpc@josefsipek.net mailto:jeffpc@josefsipek.net 2. brandon@ifup.org mailto:brandon@ifup.org Guilt v0.35 01/20/2013 GUILT-PATCHBOMB(1)
All times are GMT -4. The time now is 04:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy