awk, multiple files input and multiple files output

Hi!
I'm new in awk and I need some help.
I have a folder with a lot of files and I need that awk do something in each file and print a new file with the output. The input file name should be modified when I print the outpu files.

Thanks in advance for help!
:slight_smile:
ciao

what is this 'something' you need awk to do?

In what way must the input file be modified?

What does this input and output look like?

We need details.

the 'something' is the elimination of duplicates considering only the first column (i try '!_[$1]++' and works good for me).
I want to eliminate the duplicates (as written above) from each input file in the folder and I want an ouput file (one for each input file) that should have the same name of the input file with added something. For example: input file name is "333.e" and I would like an output file name like "333_mod.e".
The input files have two columns and I need to eliminate duplicates agreeing with the elements of the first column.
They are like:

pb_04 0,1
pb_05 0.3
pb_05 0.2
pb_12 0.85
... ...

in this case i need to eliminate one row with pb_05.

thanks!

How about this ?

awk '!a[$1]{a[$1]++;print $0 > FILENAME"_mod"}' File.txt

Thank you Pravin!! it works perfectly!!
MAy be you know also how can I apply it for a list of files in a folder?
All the files have some equal words in the name and their name look like 3254_blabla.e

Don't forget to close the files in awk, or it will break if there are many output files..