I am interested in writing a really simple alias to search for duplicates in file names in a given directory.
As an example, the file names follow a convention like:
These are all files in some directory, and I am looking to have the alias show the two 55566 duplicates.
If possible, I would prefer that it not write to a flat file or anything, just a basic search if possible. Thanks in advance for your help!
Last edited by Scott; 07-10-2011 at 04:43 PM..
Reason: Code tags
No, that's what I was talking about with the flat file thing, if I can avoid creating a file of the filenames that would be preferred, so I don't have to create a file just to delete it in 10 seconds.
If that's the only way to do it though, maybe I have to go that route.
Yeah you are correct on that, let me rephrase the example file names (the confusion was my misswording what I meant)
And I would like the Alias to find/separate out
So basically, finding file names that have a commonality. NOTE: In what I am specifically searching through, the numbers that would have commonality are all the same number of characters into the file name (ie, don't have to worry that TGIFRIDAYS and QDOBA are different character lengths)
Last edited by Scott; 07-10-2011 at 04:44 PM..
Reason: Code tags
That is exactly what I was looking for, thank you so much
---------- Post updated at 02:28 PM ---------- Previous update was at 02:15 PM ----------
So as a follow up, how can I adjust the code to search for duplicates in different columns separated by an underscore.
An example of what I mean:
So finding duplicates in the second column yields:
Finding duplicates in the third column yields:
From the original line, I think this logic is in the "_" section right after perl -F, but I wasn't able to get it to work like I originally thought it was.
Thanks again!
Last edited by Scott; 07-10-2011 at 04:44 PM..
Reason: Code tags, please...
Data files coming in different names in a file name called process.txt.
1. shipments_yyyymmdd.gz
2 Order_yyyymmdd.gz
3. Invoice_yyyymmdd.gz
4. globalorder_yyyymmdd.gz
The process needs to discard all the below files and only process two of the 4 file names available
... (1 Reply)
Hello everyone
We have a problem about searching and copying files with variables.
we have variables like $year $jday $date and we want to search the files whose name contain these variables.
we tried *$year*$jday*$date or with ? instead of *
thank you everyone!!! (4 Replies)
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Hi guys, I am a newbie here :wall:
I need a script that can search for a file in a directory and copy the contents of that file in a new file.
Please help me. :confused: Thanks in advance~ (6 Replies)
Need to develop a unix shell script for the below requirement and I need your assistance:
1) search for file.log and file.bad file in a directory and read them
2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file
4) concatinate each row from bad file as... (3 Replies)
Sun Solaris Unix Question
Haven't been able to find any solution for this situation. Let's just say the file names listed below exist in a directory. I want the find command to find all files in this directory but at the same time I want to eliminate certain file names or files with certain... (2 Replies)
Hello everyone,
My OS is AIX 5.2
I would like some help in getting command syntax that does the following:
1. Searches simultaneously several directories downward;
2. Checks every subdirectory in each directory (and so on...) for file names that contain certain characters such as “~”, start... (0 Replies)
Hi
How can i dynamically read files names from a list file and execute them from a single shell script.
Please help its urgent
Thanks in Advance (4 Replies)
Hi All,
I have two comma separated value(CSV) files, say FileA and FileB.
The contents looks like that shown below.
FileA
EmpNo,Name,Age,Sex,
1000,ABC,23,M,
1001,DES,24,F, ... (2 Replies)