10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to get the file extension with file names that could contain multiple dots using shell scripting. I want to find a way using the sed command.
Example Filenames:
one.dat
one.dat.002
Results:
dat
I would like to return dat in both instances using the sed command. How can I... (4 Replies)
Discussion started by: smkremer
4 Replies
2. Shell Programming and Scripting
Here is a simplified example of my problem. Say I have the following 3 sub-directories;
./folder1
A.txt
A.sh
./folder2
B.txt
./folder3
C.txt
C.sh
I would like to list the directory names which contain both '.txt' & '.sh' type extensions. I have came up with the following code;... (8 Replies)
Discussion started by: mmab
8 Replies
3. Shell Programming and Scripting
hi all,
I want to remove filenames beginning with multiple dots.how I can do this.
Thanks in advance (5 Replies)
Discussion started by: sriharsharavi
5 Replies
4. Shell Programming and Scripting
HI,
I have some csv files with mutiple extensions, I want to remove all the extensions and keep only the .csv extension.
anybody can suggest me how to do this.
source files
1.txt.csv.txt.csv.csv.txt.csv
2.csv.txt.csv.txt.csv.txt
target
1.csv
2.csv
--Wang (1 Reply)
Discussion started by: wangkc
1 Replies
5. Shell Programming and Scripting
Hi all,
I have files in the filename pattern of,
this.is.the.name.of.my.file.mov
and I would like to remove dots (.) and replace them with spaces ( ) so the output would be,
this is the name of my file.mov
The other issue that I have is that the number of dots (.) in the file... (6 Replies)
Discussion started by: Monkey Dean
6 Replies
6. UNIX for Dummies Questions & Answers
I copied some files to another folder, and I want to change them from .doc extensions to .txt extensions. I tried using the cp and mv commands, but it didn't work. Is it possible to change file extensions with these commands, and if so how do I do it? I tried using the * wildcard (say cp *.doc... (1 Reply)
Discussion started by: Straitsfan
1 Replies
7. Shell Programming and Scripting
Friends
I want to automat sending a letter to different persons whose directories are named as 001, 002, 003, 004.
To push the same letter to all these directories, I need to name the letter as letter.001, letter.002 like that.
Is there any method whereby I get the extension of this letter... (2 Replies)
Discussion started by: chssastry
2 Replies
8. Shell Programming and Scripting
Hi,
I have files with names like file1.txt.txt.txt.txt and file2.txt.txt.txt.txt.txt............ (random infinite number of .txt exist).
how to truncate (mv) their names to ones with single .txt extension like file1.txt and file1.txt ? In other words, how to extract the filename upto first... (12 Replies)
Discussion started by: prvnrk
12 Replies
9. Shell Programming and Scripting
I have written a shell script and in my script i have a variable
filename=myfile.txt
now, i want another variable to be defined for which i have to strip out the extension fo the file name,
i.e. newvariable= myfile
how do i strip out the ".txt" part from my first variable.
Any kind of help... (4 Replies)
Discussion started by: ramky79
4 Replies
10. Shell Programming and Scripting
I want to use find to locate files with two different extensions, and run a grep on the results. The closest I have gotten is incredibly slow and ugly:
for i in `ls -laR|egrep -e '(.js|.css)'`; do find . -name $i -print|xargs grep -H searchBg; done;
This method makes my eyes bleed. Help! ;)
... (2 Replies)
Discussion started by: r0sc0
2 Replies