The following script creates a file containing the mv commands needed to rename the files as you requested, and then runs those commands, and removes that file. Before running this script, I strongly suggest commenting out the last two lines, run the modified script and verify that the command file created performs the file moves that you want to perform. This script is written using ksh, but it should also work with at least bash and sh. ---------- Post updated at 10:01 AM ---------- Previous update was at 09:44 AM ----------
Quote:
Originally Posted by princetd001
... ... ...
you have mentoned id00020079 to id000[0-9]* ; does this [0-9] consider all digital numbers starting from 7111.
I forgot to mention this in my last posting. Instead of the command:
in the script in my last posting, I could have just used:
but if there are enough files in one of the directories being processed it would be possible to end up unintentionally renaming one or more of the renamed files (possibly even creating an infinite loop of mv commands). This isn't likely since we're renaming files rather than creating additional files, but the standards don't guarantee that a file will be found at all nor that a file will only be found once if a directory is being changed while the find utility is processing that directory. Using the two step process given in my script avoids this possible complication.
I have a .csv file and i use the below while loop to navigate through it
But i need to loop from the second line since the first line is the header
How will i do it?? please help
while IFS=, read Filename Path size readonly
do
echo "Filename -> ${Filename}"
echo "Path -> ${Path}"
echo... (8 Replies)
Hi i have wriiten a script which fetches the data from text file, and saves in the output in a text file itself, but i want that the output should save in different columns.
I have the output like:
For Channel:response_time__24.txt
1547 data points
0.339
0.299
0.448
0.581
7.380
... (1 Reply)
Hi
I need to execute a select statement in a solaris environment with oracle database. The select statement returns number of rows of data.
I need the data to be inserted into a CSV file with proper format. For that we normally use "You have to select all your columns as one big string,... (2 Replies)
Hi Unix gurus,
Maybe it is too much to ask for but please take a moment and help me out. A very humble request to you gurus. I'm new to Unix and I have started learning Unix. I have this project which is way to advanced for me.
File format: CSV file
File has four columns with no header... (8 Replies)
Hi,
I have a text file with the following format. Some of the fields are blank.
1234 3456 23 45464 327837283232 343434
5654353 34 34343 3434345 434242
....
....
....
I need to convert this file to a CSV file, like
1234, ,23, ... (3 Replies)
Hi
I am writing a shell script to parse a CSV file , in which i am facing a problem to separate the columns . Could some one help me with it.
IN301330/00001 pvavan kumar limited xyz@ttccpp.com
IN302148/00002 PRECIOUS SECURITIES (P) LTD viash@yahoo.co.in
IN300239/00000 CENTRE india... (8 Replies)
Hi, all
I want to sort a csv file based on timestamp from oldest to newest and save the output as csv file itself. Here is an example of my csv file.
test.csv
SourceFile,DateTimeOriginal
/home/intannf/foto/IMG_0739.JPG,2015:02:17 11:32:21
/home/intannf/foto/IMG_0749.JPG,2015:02:17 11:37:28... (10 Replies)
Hi,
I have another problem. I want to sort another csv file by the first field.
result.csv
SourceFile,Airspeed,GPSLatitude,GPSLongitude,Temperature,Pressure,Altitude,Roll,Pitch,Yaw
/home/intannf/foto5/2015_0313_090651_219.JPG,0.,-7.77223,110.37310,30.75,996.46,148.75,180.94,182.00,63.92 ... (2 Replies)
Hi All,
I have a data file and need to extract and convert it into csv format:
1) Read and extract the line containing string ending with "----" (file sample_linebyline.txt file) and to make a .csv file from this.
2) To read the flat file flatfile_sample.txt which consists of similar data (... (9 Replies)
Discussion started by: abhi_123
9 Replies
LEARN ABOUT CENTOS
symlink
SYMLINK(2) Linux Programmer's Manual SYMLINK(2)NAME
symlink - make a new name for a file
SYNOPSIS
#include <unistd.h>
int symlink(const char *oldpath, const char *newpath);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
symlink():
_BSD_SOURCE || _XOPEN_SOURCE >= 500 || _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED || _POSIX_C_SOURCE >= 200112L
DESCRIPTION
symlink() creates a symbolic link named newpath which contains the string oldpath.
Symbolic links are interpreted at run time as if the contents of the link had been substituted into the path being followed to find a file
or directory.
Symbolic links may contain .. path components, which (if used at the start of the link) refer to the parent directories of that in which
the link resides.
A symbolic link (also known as a soft link) may point to an existing file or to a nonexistent one; the latter case is known as a dangling
link.
The permissions of a symbolic link are irrelevant; the ownership is ignored when following the link, but is checked when removal or renam-
ing of the link is requested and the link is in a directory with the sticky bit (S_ISVTX) set.
If newpath exists it will not be overwritten.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EACCES Write access to the directory containing newpath is denied, or one of the directories in the path prefix of newpath did not allow
search permission. (See also path_resolution(7).)
EDQUOT The user's quota of resources on the file system has been exhausted. The resources could be inodes or disk blocks, depending on the
file system implementation.
EEXIST newpath already exists.
EFAULT oldpath or newpath points outside your accessible address space.
EIO An I/O error occurred.
ELOOP Too many symbolic links were encountered in resolving newpath.
ENAMETOOLONG
oldpath or newpath was too long.
ENOENT A directory component in newpath does not exist or is a dangling symbolic link, or oldpath is the empty string.
ENOMEM Insufficient kernel memory was available.
ENOSPC The device containing the file has no room for the new directory entry.
ENOTDIR
A component used as a directory in newpath is not, in fact, a directory.
EPERM The file system containing newpath does not support the creation of symbolic links.
EROFS newpath is on a read-only file system.
CONFORMING TO
SVr4, 4.3BSD, POSIX.1-2001.
NOTES
No checking of oldpath is done.
Deleting the name referred to by a symlink will actually delete the file (unless it also has other hard links). If this behavior is not
desired, use link(2).
SEE ALSO ln(1), lchown(2), link(2), lstat(2), open(2), readlink(2), rename(2), symlinkat(2), unlink(2), path_resolution(7), symlink(7)COLOPHON
This page is part of release 3.53 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/.
Linux 2013-01-27 SYMLINK(2)