ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a text file that is filled with references to duplicate files.
I'm trying to create a text file for each duplicate file found that contains the paths to the duplicates. I would also like the text file names to be based on the size and file name.
Do you have any previous programming experience? The problem you asked could be rather easily solved in any number of languages. I would go for python (or perl, if you prefer. Or even Bash, if you're strangely masochistic)
And I assume that that was an extract you posted, rather than the whole file, or it would be far far quicker to just do it by hand
I do have some programming experience. I'm familiar with C,C++,VB 6, PHP, ASP, COBOL...but I haven't coded in a while. I have taken a look at phython in the past.
And you are correct, that is only a partial sample of the file in question. The files is a 50 MB text file.
I don't know what do you mean for filter. It is simply an awk piece of code.
Quote:
Originally Posted by Mithrilhall
I think I see how it is used:
Code:
awk -f (your file) input_file
Exactly!
awk is a very powerful tool to parse and extract information from text files. However if you want to learn or refresh a new language, python is more complete since - as you already know - it offers a huge collection of libraries for a large variety of tasks. Anyway, normally you don't need to develop complicate awk programs but you can consider it as a handy command line utility, so that you can limit your learning process to the basics.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.