bash script for selecting grib files with cdo


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash script for selecting grib files with cdo
# 1  
Old 03-24-2010
Data bash script for selecting grib files with cdo

hi, i am new with scripts and have a little problem.

i have a file with dates in the form YYYYMMDD, in average about 40 days per year.
now i shall cut those days with cdo selday from monthly files.
the script shall look up the days, forward them to the cdo operator and write the new grib files with the last day (sometimes there are some consecutive days).
this is my script so far:
Code:
rrdata=`cat rrstark_alldays.dat`

for i in $YYYYMMDD; do
        echo $i
done
for file in 'ls *.grb'; do
        cdo selday, DD, gp500_era40_europeYYYYMM.grb > gp500_$i_rrstrong.grb
done

has anybody exprience with such a problem?
thx a lot, judith

Last edited by jim mcnamara; 03-24-2010 at 08:31 AM.. Reason: code tags
# 2  
Old 03-24-2010
I think the top loop is supposed to be around the second loop:
Code:
for i in $YYYYMMDD; do
        echo $i

    for file in 'ls *.grb'; do
        cdo selday, DD, gp500_era40_europeYYYYMM.grb > gp500_$i_rrstrong.grb
    done
done

assuming I understood your problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP in shell script and selecting files for upload

Hi, Im a newbie with programming and shell scripting. Im running OSX/Mac and Darwin. I would like to create a shell script that would : 1. Search a Volume and directory (including subdirectories) for a file that : * filename ends with ”_Highres.pdf” and * the file creation date of... (8 Replies)
Discussion started by: NickeZ28
8 Replies

2. Shell Programming and Scripting

Bash script deleting my files, and editing files in subdirectories question

#!/bin/bash # name=$1 type=$2 number=1 for file in ./** do if then filenumber=00$number elif then filenumber=0$number fi tempname="$name""$filenumber"."$type" if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies

3. Shell Programming and Scripting

awk for selecting columns of different data files

Hello friends, How can I use awk commands to obtain selective blocks from different data files. For example file1 a b c d e f g h i file2 1 2 3 4 5 6 7 8 9 output a b 2 3 d e 5 6 g h 8 9 is it possible ? (2 Replies)
Discussion started by: rpf
2 Replies

4. Shell Programming and Scripting

selecting certain files

Hi, I have been working on a punch of codes and I got to a problem I hope to get help on. I have some files that I want to work with but the folder has other files in it. For example: The folder contains these files: path to files: /home/distribution/ ls: b.10; b.11; b.12; b.20; b.222;... (2 Replies)
Discussion started by: iconig
2 Replies

5. Windows & DOS: Issues & Discussions

[Template] Send SMTP email with Visual Basic Script (vbs) from Command Prompt using CDO

This is a script in visual basic that basically sends an email from an existing account, in this case the example is provided for live.com. It uses CDO (Collaboration Data Objects). All you need to do is replace the fields with the proper information. The email is send from Command Prompt... (0 Replies)
Discussion started by: Tribe
0 Replies

6. Shell Programming and Scripting

Selecting strings with - as first character in bash

I have a variable containing a list of strings, and want to create a string with the first character being -. Example: var="-name fred paul -surname winnett dimech" I want a string, namely errStr="-name -surname" (2 Replies)
Discussion started by: kristinu
2 Replies

7. Shell Programming and Scripting

selecting files with text extension

I have a script that read some values from the properties file and move files from source folder to destination folder based upon the modification time of the files created (N configurable days), rite now it pick up all types of files from source folder and put it into destination folder the script... (2 Replies)
Discussion started by: nks342
2 Replies

8. UNIX for Dummies Questions & Answers

massive tarred grib files totally unacceptable

Hi, I have 7 terabytes of tar files, one for every single day since 1980. Inside these tar files are GRIB files, each with 100+ variables. There's 8 GRIBs in each tar, corresponding to different times of the day. I need 6 friggin variables..., and it takes TWO WEEKS TO EXTRACT ALL THE TAR FILES... (3 Replies)
Discussion started by: sammysoil
3 Replies

9. Shell Programming and Scripting

Bash folder manipulation - selecting/copying specified files

Bash/scripting newbie here - I feel this might be a trivial problem, but I'm not sure how to tackle it. I've got a folder of a year's worth of files, with some random number of files generated every day of the year (but at least one per day). I'm writing a script to automatically grab the file with... (6 Replies)
Discussion started by: WildGooseChased
6 Replies

10. Shell Programming and Scripting

cdo

good day, i have a file.nc with daily data in it from 1990-1992. how can i use cdo to give the data in mothly format where the months is an average of the number of days within a month... i have tried: cdo ymonmean echam_amip_${var2}_ensmean.nc... (2 Replies)
Discussion started by: zaneded
2 Replies
Login or Register to Ask a Question