05-28-2012
Change unique file names into new unique filenames
I have 84 files with the following names splitseqs.1, spliseqs.2 etc.
and I want to change the .number to a unique filename.
E.g.
change splitseqs.1 into splitseqs.7114_1#24
and
change spliseqs.2 into splitseqs.7067_2#4
So all the current file names are unique, so are the new file names.
Would appreciate if someone could help me with things!!
Thanks in advance =)
Cheers,
Astrid
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
Since I need to maintain the file name with time stamp as unique in unix, i need to write script.
Is there any way to capture the milli/micro seconds of unix system.
Please reply me. (2 Replies)
Discussion started by: spkandy
2 Replies
2. Shell Programming and Scripting
I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM".
I can find the line number for the beginning of the statement section with sed.
... (5 Replies)
Discussion started by: andrewsc
5 Replies
3. UNIX for Dummies Questions & Answers
I have a large directory of web pages. I am doing a search through the web pages using grep and would like to get a list of unique file names of search results. The following command works fine to give me a list of file names where term appears:
grep -l term *.html
However, since these are... (3 Replies)
Discussion started by: rjulich
3 Replies
4. Shell Programming and Scripting
Hi Unix Gurus,
In a script, I am trying to extract unique text from a set of filenames.
I have certain files like below in a directory:
OPEN_INV_01012011.xls
OPEN_INV_01022011.xls
OPEN_INV_01032011.xls
CLOSE_INV_01012011.xls
CLOSE_INV_01022011.xls
I need to extract just "OPEN_INV_" ... (4 Replies)
Discussion started by: shankar1dada
4 Replies
5. Shell Programming and Scripting
Is it possible to remove redundant names in the 4th column?
input
cqWE 100 200 singapore;singapore
AZO 300 400 brazil;america;germany;ireland;germany
....
....
output
cqWE 100 200 singapore
AZO 300 400 brazil;america;germany;ireland (4 Replies)
Discussion started by: quincyjones
4 Replies
6. Shell Programming and Scripting
Is it possible to modify file like this.
1. Remove all the duplicate names in a define column i.e 4th col
2. Count the no.of unique names separated by ";" and print as a 5th col
thanx in advance!!
Q
input
c1 30 3 Eh2
c10 96 3 Frp
c41 396 3 Ua5;Lop;Kol;Kol
c62 2 30 Fmp;Fmp;Fmp
... (5 Replies)
Discussion started by: quincyjones
5 Replies
7. UNIX for Dummies Questions & Answers
I would like to print unique lines without sort or unique. Unfortunately the server I am working on does not have sort or unique. I have not been able to contact the administrator of the server to ask him to add it for several weeks. (7 Replies)
Discussion started by: cokedude
7 Replies
8. Shell Programming and Scripting
I'm attempting to write a script that will look into a directory, discover all unique names, create directories for their prefix names and place the files inside. I do this now one by one with a simple script but I'd like to automate the process.
The directory would contain something like: ... (6 Replies)
Discussion started by: scribling
6 Replies
9. Shell Programming and Scripting
Hello Team,
I need your help on the following:
My input file a.txt is as below:
3330690|373846|108471
3330690|373846|108471
0640829|459725|100001
0640829|459725|100001
3330690|373847|108471
Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Discussion started by: angshuman
4 Replies
10. UNIX for Beginners Questions & Answers
Dear Users,
Appreciate your help if you could help me with splitting a large file > 1 million lines with sed or awk. below is the text in the file
input file.txt
scaffold1 928 929 C/T +
scaffold1 942 943 G/C +
scaffold1 959 960 C/T +... (6 Replies)
Discussion started by: kapr0001
6 Replies
MKTEMP(3) Linux Programmer's Manual MKTEMP(3)
NAME
mktemp - make a unique temporary filename
SYNOPSIS
#include <stdlib.h>
char *mktemp(char *template);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
mktemp(): _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE >= 500
DESCRIPTION
The mktemp() function generates a unique temporary filename from template. The last six characters of template must be XXXXXX and these
are replaced with a string that makes the filename unique. Since it will be modified, template must not be a string constant, but should
be declared as a character array.
RETURN VALUE
The mktemp() function always returns template. If a unique name was created, the last six bytes of template will have been modified in
such a way that the resulting name is unique (i.e., does not exist already) If a unique name could not be created, template is made an
empty string.
ERRORS
EINVAL The last six characters of template were not XXXXXX.
CONFORMING TO
4.3BSD, POSIX.1-2001. POSIX.1-2008 removes the specification of mktemp().
NOTES
The prototype is in <unistd.h> for libc4, libc5, glibc1; glibc2 follows the Single Unix Specification and has the prototype in <stdlib.h>.
BUGS
Never use mktemp(). Some implementations follow 4.3BSD and replace XXXXXX by the current process ID and a single letter, so that at most
26 different names can be returned. Since on the one hand the names are easy to guess, and on the other hand there is a race between test-
ing whether the name exists and opening the file, every use of mktemp() is a security risk. The race is avoided by mkstemp(3).
SEE ALSO
mkstemp(3), tempnam(3), tmpfile(3), tmpnam(3)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU
2008-08-06 MKTEMP(3)