Sponsored Content
Top Forums Shell Programming and Scripting How to remove filenames having the same extension.? Post 302841387 by Just Ice on Wednesday 7th of August 2013 09:38:58 AM
Old 08-07-2013
sample below uses the same list as ravinder ... not as elegant as balajesuri's code but should be easy enough to understand ...
Code:
[root@centosgeek ~]# for ext in $(awk -F"[._]" '{print $NF}' testfile2 | sort -u);
> do
>     grep $ext testfile2 | head -1
> done
s6.def.excel
s7.def.lxs
s4_def.txs
s1_abc.txt
s2_def.xls
[root@centosgeek ~]#

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Adding an extension to a group of filenames

Hi - I'm stuck. I have a group of text files created using the split command. My files have the names "projectaa", "projectab", "projectac", etc. What I want to do is add the extension ".txt" to each file. I think I've got part of a sed command together, but I'm stuck on my regex - I keep getting... (9 Replies)
Discussion started by: pepintheshort
9 Replies

2. Shell Programming and Scripting

Remove prefix from filenames

I'm trying to put together a shell script that will append specific prefixes based on the content of filenames. I think I have this part down. However, I want to append before that part a process that will remove the current prefix before it renames the files with the new prefix. For example,... (6 Replies)
Discussion started by: HLee1981
6 Replies

3. Shell Programming and Scripting

remove file extension

Hi ALL, I'm new to this forum. Thanks and congrats to all for their great efforts building this site simply superb for all unix administrators. My requirement is to remove extensions of the files in the current directory. I'm doing it using below script which is working but i think it is... (12 Replies)
Discussion started by: prvnrk
12 Replies

4. Shell Programming and Scripting

Reading filenames with extension .xml

Hi, I want to write a script to read all the filenames with extension .xml in a directory and pass the name of the file, one by one, to another function. Please help me out. Regards. Saurabh (3 Replies)
Discussion started by: bhalotias
3 Replies

5. UNIX for Dummies Questions & Answers

removing the extension from all filenames in a folder

Hi there, I'm pretty new to UNIX and have tried trawling through this forum to find an answer to what I want to try to do, which I'm sure is very simple but I don't know how to do it. What I have a a folder that contains multiple files that I have copied from Windows and I want to remove the... (5 Replies)
Discussion started by: johnmcclintock
5 Replies

6. Shell Programming and Scripting

change filenames but not extension

I have a filename with a bunch of periods that I want to replace with underscores, but I don't want to change the extension. Ex: I want file.test1.f-1.fig.eps to be file_test1_f-1_fig.eps Using awk, the following line will replace ALL periods with underscores, but I want to leave the... (2 Replies)
Discussion started by: erinbot
2 Replies

7. Shell Programming and Scripting

Remove spaces in filenames

Hi, I have files like below, In files coming as spaces. Before transfering those files into ftp server. I want to remove the spaces and then can transfer the files into unix server. e.g: filenames are 1) SHmail _profile001_20120908.txt 2) SHmail_profile001 _20120908.txt 3) sh... (3 Replies)
Discussion started by: kirankumar
3 Replies

8. Shell Programming and Scripting

Remove the file except with particular extension

Hi all i am new for the shell scripting can any one help me with my requirments . i want to delete file older than 21 days everything works fine but in that dir i got the files with should not be deleted with particular extension like (.info):confused:here is the script i wrote .can anyone... (5 Replies)
Discussion started by: vikatakavi
5 Replies

9. Shell Programming and Scripting

Remove extension in loop

Dear all sorry for bothering you wityh dumb question but I am stucked with an issue. Well, I am trying to loop over files in folder, make an operation and rewrite the output. Example: INPUT file1.txt file2.txt file3.txtMy command (doesn't work!!) for file in /path/to/*.txt do command... (13 Replies)
Discussion started by: giuliangiuseppe
13 Replies

10. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies
EXTCHECK(1)                                                   General Commands Manual                                                  EXTCHECK(1)

NAME
extcheck - check hierarchical ext(5) files for global node connectivity and summarize number of fets, nodes, etc. SYNOPSIS
extcheck [ -c cthresh ] [ -p path ] [ -r rthresh ] [ -s sym=value ] [ -C ] [ -R ] [ -S symfile ] [ -T tech ] root DESCRIPTION
Extcheck will read an extracted circuit in the hierarchical ext(5) representation produced by Magic, check to ensure that all global nodes (those to which a label ending in an exclamantion point is attached) are fully connected in the layout, and then print a count of the num- ber of various items (nodes, fets, etc) encountered while flattening the circuit. The root of the tree to be processed is the file root.ext; it and all the files it references are recursively flattened. The following options are recognized: -c cthresh Set the capacitance threshold to cthresh femtofarads. Extcheck will count the number of explicit internodal capacitors greater than cthresh, the number of nodes whose capacitance is greater than cthresh, as well as the total number of nodes. (Other programs such as ext2sim(1) use this option as a threshold value below which a capacitor will not be output). The default value for cthresh is 10 femtofarads. -p path Normally, the path to search for .ext files is determined by looking for path commands in first ~cad/lib/magic/sys/.magic, then ~/.magic, then .magic in the current directory. If -p is specified, the colon-separated list of directories specified by path is used instead. Each of these directories is searched in turn for the .ext files in a design. -r rthresh Set the resistance threshold to rthresh ohms. Similar in function to -c, but for resistances. The default value for rthresh is 10 ohms. -s sym=value It's possible to use special attributes attached to transistor gates to control the length and width of transistors explicitly, rather than allowing them to be determined by the extractor. These attributes are of the form ext:w=width^ or ext:l=length^, where width or length can either be numeric, or textual. (The trailing ``^'' indicates that these are transistor gate attributes). If textual, they are treated as symbols which can be assigned a numeric value at the time ext2sim is run. The -s flag is used to assign numeric values to symbols. If a textual symbol appears in one of the above attributes, but isn't given a numeric value via -s (or -S below), then it is ignored; otherwise, the transistor's length or width is set to the numeric value defined for that sym- bol. (This option is not currently used by extcheck, but it is common to ext2sim(1) and other tools that are written using the extflat(3) library) -C Set the capacitance threshold to infinity. Because this avoids any internodal capacitance processing, all tools will run faster when this flag is given. -R Set the resistance threshold to infinity. -S symfile Each line in the file symfile is of the form sym=value, just like the argument to the -s flag above; the lines are interpreted in the same fashion. (This option is not currently used by extcheck, but it is common to ext2sim et. al.) -T tech Set the technology in the output .sim file to tech. This overrides any technology specified in the root .ext file. SEE ALSO
ext2dlys(1), ext2sim(1), ext2spice(1), magic(1), rsim(1), sim2spice(1), ext(5), sim(5) AUTHOR
Walter Scott BUGS
The -s mechanism is incomplete; it should allow quantities other than transistor lengths and widths to be specified. EXTCHECK(1)
All times are GMT -4. The time now is 09:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy