Sponsored Content
Top Forums Shell Programming and Scripting looping through files with different extensions Post 302619687 by ida1215 on Friday 6th of April 2012 12:09:12 AM
Old 04-06-2012
Hi, am sorry for explaining poorly. Smilie I think my problem is on the calling of files to perform the calculations. like for instance, I would tell the loop that it will load the specific files for time-step 1 and so on. something like:
Code:
for files in u.grd and v.grd
    do 19990101u.grd + 19990101v.grd =19990101.grd
       19990102u.grd + 19990101v.grd =19990102.grd
       19990103u.grd + 19990103v.grd =19990103.grd
       and so on ...
done

How do I load these 2 file types in a loop so that I can use them both for the calculation. Thanks much.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Command to select files with different extensions

I want to select files which have different extensions such as .cpp, .cs, .h I can select one of them as find . -name "*.cpp" but I want to select all of them in one command only. It should be pretty simple but I'm not able to get it. Any help with the command will be greatly appreciated. (1 Reply)
Discussion started by: MobileUser
1 Replies

2. UNIX for Dummies Questions & Answers

List Files by Extensions

I have a unix directory with 500 plus files . When I do a ls -lR I can see ALL the files here . How can I sort this by the files extensions ? I can't enter ls -lR *.ext1 *.ext2 *.ext3 etc in case I miss out some files . (2 Replies)
Discussion started by: newbienix
2 Replies

3. Shell Programming and Scripting

Find files with 3 different extensions

Hi all, From one directory I need to fetch only files of type *.xls,*.csv,*.txt. I tried the find . -name '*.txt,*.csv,*.xls' -print. But it throws me error. Please do help me on this. Thanks Mahalakshmi.A (11 Replies)
Discussion started by: mahalakshmi
11 Replies

4. Shell Programming and Scripting

Sorting Files according to their Extensions...

I am trying to write a Korne Shell Script wherein we have to sort files according to their extensions(for eg. 1.sh, 5.sh, 9.sh together; 4.csh, 120.csh, 6.csh together and 7.ksh, 2.ksh, 59.ksh together) and move them to their respective directories viz. sh, csh and ksh... I think,... (1 Reply)
Discussion started by: marconi
1 Replies

5. UNIX for Dummies Questions & Answers

changing extensions for multiple files at once

I copied some files to another folder, and I want to change them from .doc extensions to .txt extensions. I tried using the cp and mv commands, but it didn't work. Is it possible to change file extensions with these commands, and if so how do I do it? I tried using the * wildcard (say cp *.doc... (1 Reply)
Discussion started by: Straitsfan
1 Replies

6. Shell Programming and Scripting

Rename files extensions

Hello ! i have a few files like ... setup.001 setup.002 setup.003 setup.004 // to setup.095 and i would like to rename those files to ... setup.r01 setup.r02 setup.r03 setup.r04 // to setup.r95 (7 Replies)
Discussion started by: Putazo
7 Replies

7. UNIX for Dummies Questions & Answers

How to tar files of different extensions in one command

Linux RHEL 5.4 It is easy to create a tarball when you have files same extension For eg: You want to tar all files with the extension .log . This is easy tar -cvf diagnose.tar *.log I have two files with different extensions .log and .sh : error.log myscript.sh I want to create a... (5 Replies)
Discussion started by: John K
5 Replies

8. Shell Programming and Scripting

Find duplicate files but with different extensions

Hi ! I wonder if anyone can help on this : I have a directory: /xyz that has the following files: chsLog.107.20130603.gz chsLog.115.20130603 chsLog.111.20130603.gz chsLog.107.20130603 chsLog.115.20130603.gz As you ca see there are two files that are the same but only with a minor... (10 Replies)
Discussion started by: fretagi
10 Replies

9. Shell Programming and Scripting

Copy files with different extensions and same name

Hi, i have two folders. Folder A has 1000+ files with just images named like : 01012015.png 01022015.png etc. Folder B has much more files, part of them with same name as png files folder others not. Instead of folder A wich are only images, these are audio wav files. I need to... (11 Replies)
Discussion started by: Board27
11 Replies

10. Shell Programming and Scripting

Mv all files with different extensions to a new name

Hello all! I want to move several files foo.aux foo.log foo.pdf foo.tex to bar_foo.aux bar_foo.pdf bar_foo.tex I am on tcsh % mv foo.* bar_!#:1 is not working. Thank you for your help marek (11 Replies)
Discussion started by: marek
11 Replies
GRDVOLUME(l)															      GRDVOLUME(l)

NAME
grdvolume - Calculating volume under a surface within a contour SYNOPSIS
grdvolume grdfile [ -Ccval or -Clow/high/delta ] [ -Lbase ] [ -Rwest/east/south/north[r] ] [ -S[k] ] [ -T ] [ -V[l] ] [ -Zfact[/delta] ] DESCRIPTION
grdvolume reads a 2-D binary grd file and calculates the volume contained between the surface and the plane specified by the given contour (or zero if not given). Alternatively, specify a range of contours to be tried and grdvolume will determine the volume and area inside the contour for all contour values. The contour that produced the maximum mean height (volume/area) is reported as well. This feature may be used with grdfilter in designing an Optimal Robust Separator [Wessel, 1998]. grdfile The name of the input 2-D binary grd file. OPTIONS
No space between the option flag and the associated arguments. -C find area and volume inside the cval contour. Alternatively, search using all contours from low to high in steps of delta. [Default returns entire area and volume of grid]. The area is measured in the plane of the countour. -L Also add in the volume from the level of the contour down to base [Default base is contour]. -S Convert degrees to meters, append k for km [Default is Cartesian]. -T Use curvature minimum rather than maximum height to find best contour value (when contour search is selected with -C). -R west, east, south, and north specify the Region of interest. To specify boundaries in degrees and minutes [and seconds], use the dd:mm[:ss] format. Append r if lower left and upper right map coordinates are given instead of wesn. -V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"]. Append l to see all the results for each contour level tested (when contour search has been selected). -Z Optionally subtract shift before scaling data by fact. [Default is no scaling]. (Numbers in -C, -L refer to values after this scal- ing has occurred). EXAMPLES
To determine the volume in km^3 under the surface hawaii_topo.grd (height in km), try grdvolume hawaii_topo.grd -Sk To find the volume between the surface peaks.grd and the contour z = 250, use grdvolume peaks.grd -Sk -C250 To search for the contour, between 100 and 300 in steps of 10, that maximizes the ratio of volume to surface area for the file peaks.grd, use grdvolume peaks.grd -Sk -C100/300/10 > results.d To see the areas and volumes for all the countours in the previous example, try grdvolume peaks.grd -Sk -Vl -C100/300/10 > results.d SEE ALSO
gmt(1gmt), grdfilter(1gmt) REFERENCES
Wessel, P., 1998, An empirical method for optimal robust regional-residual separation of geophysical data, Math. Geol., 30(4), 391-408. 1 Jan 2004 GRDVOLUME(l)
All times are GMT -4. The time now is 04:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy