I've got a bunch of files called oldabc, olddef etc.
i want to copy these to be abc, def....
I can do this with file extensions....but can get the logic to work for prefixes. All the files I am interested in have a prefix of 'old'.
This loop is no good for me....it looks at the content... (2 Replies)
In a foreach loop I end up with $file containing the filename INCLUDING the whole path. I want this reduced to just the filename, but I can't seem to remember how I did it some years back. I am sure I can do it with "sed", but I am pretty sure I have seen a simpler command.
Anyone?
borgeh (3 Replies)
Hi all,
Can I edit this script:
find . -type f | while read i;do && mv "$i" "${i//abc/}" ;done
so that it will not only take out abc from the filename but also take out any numbers that might be in the filename as well.
An example would be,
Input:
filename abc 2009.mov
Output:... (7 Replies)
I want to change the extensions of a folder full of files (some of the files are located in subfolders as well) to another extension, but instead of replacing the files I want the new files to be copied into a newly created folder.
Here is the folder structure:
/Downloads/3eb... (3 Replies)
Hi All,
I have different type of file (.txt,.csv,.xml) format in my current directory. My requirement is that I need to remove the last character from the file format.
Example
count.txt$
csp_rules.csv^
Date.xml~
Need Output:
count.txt
csp_rules.csv
Date.xml
How to do that?.... (5 Replies)
I want to remove the beginning and end of a filename and keep the middle.
E.g. tempblast7114_1#21110932.out_ the current filename
I want it to be called 7114_1#21 only
How would I do this?? (3 Replies)
Hello Unix board community,
I have to program a shell script, but I am a complete noob so I hope I get some help here. The assignment is as follows:
The program removes all comments regardless of formatting or language from files with specific file name extensions (php, css, js, ...).... (3 Replies)
Hello,
I need some help with renaming some files by removing a certain portion of the filename.
The current file name is: ABC_2013186197_20130708_203556.95336
I need to remove the 5 digits after the first "_". The new file name should be:
ABC_197_20130708_203556.95336
I'm not quite... (5 Replies)
Hi All!
Please can someone help, I have a dir with the following files:
~-rw-r--r-- 1 emmuser users 2087361 Oct 16 15:50 MPGGSN02_20131007234519_24291.20131007
-rw-r--r-- 1 emmuser users 2086837 Oct 16 15:50 MPGGSN02_20131007233529_24272.20131007
-rw-r--r-- 1 emmuser ... (7 Replies)
Hi team,
Here's a requirement for me.
Here are the list of files i have in a unix directory.
W 2 A D_2014.csv
W 3 A D_2014.csv
W 4 A D_2014.csv
/home/kmani00-> uname -a
AIX sliyyvxx 1 6 00F613E54C00
/home/kmani00->
The file names has to be without spaces as follows.
W2AD_2014.csv... (1 Reply)