Loop through many folders and do calculations with files with similar pattern in bash

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















I have several folders each containing several .nc files. I want to loop through all folders and for each folder do some calculations (mergetime) using cdo on files that have similar pattern. So far I have written the following:



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
cd $dir
pwd
for f in `find . -type f -regex /(.*?day)/*`
cdo mergetiem io
done
done


The files in each folder have names like the following:



pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19500101-19501231.nc
pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19491201-19501231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc


I want to apply the mergetime CDO command on all files that have similar pattern before _day_.



I want to merge the first two files and the last two files. More specifically, merge files that start with



"pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" 


and likewise merge files that start with



"pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1"


The output of the mergetime can be something like:



 pattern_mergetime.nc 









share|improve this question
























  • It is not clear which files you want to select with your find command. Please show a list of files with some matching and some non-matching files and state which ones you want to select or which files belong into the same group(s). What exactly means "similar pattern before _day_"?

    – Bodo
    Feb 12 at 12:19











  • I want to merge the first two files and the last two files. More specifically, merge files that start with "pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" and likewise merge files that start with "pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1".

    – Maria Karypidou
    Feb 12 at 12:20












  • Please add the clarification to your question instead of writing a comment.

    – Bodo
    Feb 12 at 12:28











  • I did that, thank you!

    – Maria Karypidou
    Feb 12 at 12:33











  • I had a quick look at the documentation of cdo, and I found out that the mergetime operator requires the name of the outfile. The required arguments are as follows: cdo mergetime one_or_more_input_files one_outfile. So, what or how do you want to name your output files?

    – Niko Gambt
    Feb 12 at 13:16
















0















I have several folders each containing several .nc files. I want to loop through all folders and for each folder do some calculations (mergetime) using cdo on files that have similar pattern. So far I have written the following:



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
cd $dir
pwd
for f in `find . -type f -regex /(.*?day)/*`
cdo mergetiem io
done
done


The files in each folder have names like the following:



pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19500101-19501231.nc
pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19491201-19501231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc


I want to apply the mergetime CDO command on all files that have similar pattern before _day_.



I want to merge the first two files and the last two files. More specifically, merge files that start with



"pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" 


and likewise merge files that start with



"pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1"


The output of the mergetime can be something like:



 pattern_mergetime.nc 









share|improve this question
























  • It is not clear which files you want to select with your find command. Please show a list of files with some matching and some non-matching files and state which ones you want to select or which files belong into the same group(s). What exactly means "similar pattern before _day_"?

    – Bodo
    Feb 12 at 12:19











  • I want to merge the first two files and the last two files. More specifically, merge files that start with "pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" and likewise merge files that start with "pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1".

    – Maria Karypidou
    Feb 12 at 12:20












  • Please add the clarification to your question instead of writing a comment.

    – Bodo
    Feb 12 at 12:28











  • I did that, thank you!

    – Maria Karypidou
    Feb 12 at 12:33











  • I had a quick look at the documentation of cdo, and I found out that the mergetime operator requires the name of the outfile. The required arguments are as follows: cdo mergetime one_or_more_input_files one_outfile. So, what or how do you want to name your output files?

    – Niko Gambt
    Feb 12 at 13:16














0












0








0








I have several folders each containing several .nc files. I want to loop through all folders and for each folder do some calculations (mergetime) using cdo on files that have similar pattern. So far I have written the following:



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
cd $dir
pwd
for f in `find . -type f -regex /(.*?day)/*`
cdo mergetiem io
done
done


The files in each folder have names like the following:



pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19500101-19501231.nc
pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19491201-19501231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc


I want to apply the mergetime CDO command on all files that have similar pattern before _day_.



I want to merge the first two files and the last two files. More specifically, merge files that start with



"pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" 


and likewise merge files that start with



"pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1"


The output of the mergetime can be something like:



 pattern_mergetime.nc 









share|improve this question
















I have several folders each containing several .nc files. I want to loop through all folders and for each folder do some calculations (mergetime) using cdo on files that have similar pattern. So far I have written the following:



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
cd $dir
pwd
for f in `find . -type f -regex /(.*?day)/*`
cdo mergetiem io
done
done


The files in each folder have names like the following:



pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19500101-19501231.nc
pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19491201-19501231.nc
pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1_day_19510101-19551231.nc


I want to apply the mergetime CDO command on all files that have similar pattern before _day_.



I want to merge the first two files and the last two files. More specifically, merge files that start with



"pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" 


and likewise merge files that start with



"pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1"


The output of the mergetime can be something like:



 pattern_mergetime.nc 






bash files regular-expression






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 12 at 13:20







Maria Karypidou

















asked Feb 12 at 12:05









Maria KarypidouMaria Karypidou

11




11












  • It is not clear which files you want to select with your find command. Please show a list of files with some matching and some non-matching files and state which ones you want to select or which files belong into the same group(s). What exactly means "similar pattern before _day_"?

    – Bodo
    Feb 12 at 12:19











  • I want to merge the first two files and the last two files. More specifically, merge files that start with "pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" and likewise merge files that start with "pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1".

    – Maria Karypidou
    Feb 12 at 12:20












  • Please add the clarification to your question instead of writing a comment.

    – Bodo
    Feb 12 at 12:28











  • I did that, thank you!

    – Maria Karypidou
    Feb 12 at 12:33











  • I had a quick look at the documentation of cdo, and I found out that the mergetime operator requires the name of the outfile. The required arguments are as follows: cdo mergetime one_or_more_input_files one_outfile. So, what or how do you want to name your output files?

    – Niko Gambt
    Feb 12 at 13:16


















  • It is not clear which files you want to select with your find command. Please show a list of files with some matching and some non-matching files and state which ones you want to select or which files belong into the same group(s). What exactly means "similar pattern before _day_"?

    – Bodo
    Feb 12 at 12:19











  • I want to merge the first two files and the last two files. More specifically, merge files that start with "pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" and likewise merge files that start with "pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1".

    – Maria Karypidou
    Feb 12 at 12:20












  • Please add the clarification to your question instead of writing a comment.

    – Bodo
    Feb 12 at 12:28











  • I did that, thank you!

    – Maria Karypidou
    Feb 12 at 12:33











  • I had a quick look at the documentation of cdo, and I found out that the mergetime operator requires the name of the outfile. The required arguments are as follows: cdo mergetime one_or_more_input_files one_outfile. So, what or how do you want to name your output files?

    – Niko Gambt
    Feb 12 at 13:16

















It is not clear which files you want to select with your find command. Please show a list of files with some matching and some non-matching files and state which ones you want to select or which files belong into the same group(s). What exactly means "similar pattern before _day_"?

– Bodo
Feb 12 at 12:19





It is not clear which files you want to select with your find command. Please show a list of files with some matching and some non-matching files and state which ones you want to select or which files belong into the same group(s). What exactly means "similar pattern before _day_"?

– Bodo
Feb 12 at 12:19













I want to merge the first two files and the last two files. More specifically, merge files that start with "pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" and likewise merge files that start with "pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1".

– Maria Karypidou
Feb 12 at 12:20






I want to merge the first two files and the last two files. More specifically, merge files that start with "pr_AFR-44_CNRM-CERFACS-CNRM-CM5_historical_r1i1p1_CLMcom-CCLM4-8-17_v1_" and likewise merge files that start with "pr_AFR-44_ICHEC-EC-EARTH_historical_r12i1p1_CLMcom-CCLM4-8-17_v1".

– Maria Karypidou
Feb 12 at 12:20














Please add the clarification to your question instead of writing a comment.

– Bodo
Feb 12 at 12:28





Please add the clarification to your question instead of writing a comment.

– Bodo
Feb 12 at 12:28













I did that, thank you!

– Maria Karypidou
Feb 12 at 12:33





I did that, thank you!

– Maria Karypidou
Feb 12 at 12:33













I had a quick look at the documentation of cdo, and I found out that the mergetime operator requires the name of the outfile. The required arguments are as follows: cdo mergetime one_or_more_input_files one_outfile. So, what or how do you want to name your output files?

– Niko Gambt
Feb 12 at 13:16






I had a quick look at the documentation of cdo, and I found out that the mergetime operator requires the name of the outfile. The required arguments are as follows: cdo mergetime one_or_more_input_files one_outfile. So, what or how do you want to name your output files?

– Niko Gambt
Feb 12 at 13:16











1 Answer
1






active

oldest

votes


















0














This script snippet would work with your example files



for file in *.nc
do
echo "$file"
done | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done


Explanation:



  • The for loop with echo prints one file name per line.

  • The sed command removes _day_ and all following characters.


  • sort -u sorts the partial file names and removes duplicates.


  • while read -r pattern reads one pattern per line and loops over the patterns


  • "$pattern"* is expanded by the shell to all file names starting with the pattern

Better than the for loop with echo might be



find . -maxdepth 1 -type f -name '*.nc'


This will print all file names matching *.nc in the current directory without subdirectories.



You can combine this with a loop over all subdirectories similar to the script in the question



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
pushd $dir
pwd

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done


Instead of cd I propose pushd to allow going back with popd later.



You could also replace the for loop over the directories with an additional find



find /mnt/meteo_a/africa_cordex/historical/0.44/pr -maxdepth 1 -mindepth 1 -type d | while read dir
do
pushd "$dir"

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done





share|improve this answer

























  • This works! Thank you!

    – Maria Karypidou
    Feb 12 at 13:33











  • @MariaKarypidou If it works you can accept the answer. I read in a comment that the cdo command needs an output file argument. I will add this to my answer.

    – Bodo
    Feb 12 at 13:37











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500157%2floop-through-many-folders-and-do-calculations-with-files-with-similar-pattern-in%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This script snippet would work with your example files



for file in *.nc
do
echo "$file"
done | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done


Explanation:



  • The for loop with echo prints one file name per line.

  • The sed command removes _day_ and all following characters.


  • sort -u sorts the partial file names and removes duplicates.


  • while read -r pattern reads one pattern per line and loops over the patterns


  • "$pattern"* is expanded by the shell to all file names starting with the pattern

Better than the for loop with echo might be



find . -maxdepth 1 -type f -name '*.nc'


This will print all file names matching *.nc in the current directory without subdirectories.



You can combine this with a loop over all subdirectories similar to the script in the question



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
pushd $dir
pwd

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done


Instead of cd I propose pushd to allow going back with popd later.



You could also replace the for loop over the directories with an additional find



find /mnt/meteo_a/africa_cordex/historical/0.44/pr -maxdepth 1 -mindepth 1 -type d | while read dir
do
pushd "$dir"

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done





share|improve this answer

























  • This works! Thank you!

    – Maria Karypidou
    Feb 12 at 13:33











  • @MariaKarypidou If it works you can accept the answer. I read in a comment that the cdo command needs an output file argument. I will add this to my answer.

    – Bodo
    Feb 12 at 13:37
















0














This script snippet would work with your example files



for file in *.nc
do
echo "$file"
done | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done


Explanation:



  • The for loop with echo prints one file name per line.

  • The sed command removes _day_ and all following characters.


  • sort -u sorts the partial file names and removes duplicates.


  • while read -r pattern reads one pattern per line and loops over the patterns


  • "$pattern"* is expanded by the shell to all file names starting with the pattern

Better than the for loop with echo might be



find . -maxdepth 1 -type f -name '*.nc'


This will print all file names matching *.nc in the current directory without subdirectories.



You can combine this with a loop over all subdirectories similar to the script in the question



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
pushd $dir
pwd

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done


Instead of cd I propose pushd to allow going back with popd later.



You could also replace the for loop over the directories with an additional find



find /mnt/meteo_a/africa_cordex/historical/0.44/pr -maxdepth 1 -mindepth 1 -type d | while read dir
do
pushd "$dir"

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done





share|improve this answer

























  • This works! Thank you!

    – Maria Karypidou
    Feb 12 at 13:33











  • @MariaKarypidou If it works you can accept the answer. I read in a comment that the cdo command needs an output file argument. I will add this to my answer.

    – Bodo
    Feb 12 at 13:37














0












0








0







This script snippet would work with your example files



for file in *.nc
do
echo "$file"
done | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done


Explanation:



  • The for loop with echo prints one file name per line.

  • The sed command removes _day_ and all following characters.


  • sort -u sorts the partial file names and removes duplicates.


  • while read -r pattern reads one pattern per line and loops over the patterns


  • "$pattern"* is expanded by the shell to all file names starting with the pattern

Better than the for loop with echo might be



find . -maxdepth 1 -type f -name '*.nc'


This will print all file names matching *.nc in the current directory without subdirectories.



You can combine this with a loop over all subdirectories similar to the script in the question



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
pushd $dir
pwd

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done


Instead of cd I propose pushd to allow going back with popd later.



You could also replace the for loop over the directories with an additional find



find /mnt/meteo_a/africa_cordex/historical/0.44/pr -maxdepth 1 -mindepth 1 -type d | while read dir
do
pushd "$dir"

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done





share|improve this answer















This script snippet would work with your example files



for file in *.nc
do
echo "$file"
done | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done


Explanation:



  • The for loop with echo prints one file name per line.

  • The sed command removes _day_ and all following characters.


  • sort -u sorts the partial file names and removes duplicates.


  • while read -r pattern reads one pattern per line and loops over the patterns


  • "$pattern"* is expanded by the shell to all file names starting with the pattern

Better than the for loop with echo might be



find . -maxdepth 1 -type f -name '*.nc'


This will print all file names matching *.nc in the current directory without subdirectories.



You can combine this with a loop over all subdirectories similar to the script in the question



for dir in /mnt/meteo_a/africa_cordex/historical/0.44/pr/*/ 
do
dir=$dir%*/
echo $dir##*/
export dir
pushd $dir
pwd

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done


Instead of cd I propose pushd to allow going back with popd later.



You could also replace the for loop over the directories with an additional find



find /mnt/meteo_a/africa_cordex/historical/0.44/pr -maxdepth 1 -mindepth 1 -type d | while read dir
do
pushd "$dir"

find . -maxdepth 1 -type f -name '*.nc' | sed 's/_day_.*//' | sort -u | while read -r pattern
do
cdo mergetime "$pattern"* "$pattern_mergetime.nc"
done

popd
done






share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 12 at 13:40

























answered Feb 12 at 12:41









BodoBodo

2,048416




2,048416












  • This works! Thank you!

    – Maria Karypidou
    Feb 12 at 13:33











  • @MariaKarypidou If it works you can accept the answer. I read in a comment that the cdo command needs an output file argument. I will add this to my answer.

    – Bodo
    Feb 12 at 13:37


















  • This works! Thank you!

    – Maria Karypidou
    Feb 12 at 13:33











  • @MariaKarypidou If it works you can accept the answer. I read in a comment that the cdo command needs an output file argument. I will add this to my answer.

    – Bodo
    Feb 12 at 13:37

















This works! Thank you!

– Maria Karypidou
Feb 12 at 13:33





This works! Thank you!

– Maria Karypidou
Feb 12 at 13:33













@MariaKarypidou If it works you can accept the answer. I read in a comment that the cdo command needs an output file argument. I will add this to my answer.

– Bodo
Feb 12 at 13:37






@MariaKarypidou If it works you can accept the answer. I read in a comment that the cdo command needs an output file argument. I will add this to my answer.

– Bodo
Feb 12 at 13:37


















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500157%2floop-through-many-folders-and-do-calculations-with-files-with-similar-pattern-in%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)