Search Results

Search: Posts Made By: Muhammad Rahiz
4,078
Posted By Muhammad Rahiz
thanks - that works.
thanks - that works.
4,078
Posted By Muhammad Rahiz
bad substitution
#!/bin/bash

a1=( win 12,01,02,03,04 )
a2=( pre 04,05,06 )
a3=( msn 06,07,08,09 )

Given the above arrays, I want the script to return/echo the following in a loop;

win
12,01,02,03,04
...
12,563
Posted By Muhammad Rahiz
hi again scottn, i didn't realise your post...
hi again scottn,

i didn't realise your post contains two parts - i overlooked the second part.

And yes, that is what I want - thanks!

I did more search and found this works as well;

...
12,563
Posted By Muhammad Rahiz
hi scottn, Thanks for the reply. I'm going...
hi scottn,

Thanks for the reply. I'm going to do further process with my files hence the "cat" command does not meet the requirement.
12,563
Posted By Muhammad Rahiz
Read two text files in bash
Hi all,

I have two files;

file1.txt contains
Jan
Feb
March

file2.txt contains
01
02
03

How do i read the two files in a bash script so that it echos the following;

Jan 01
Feb 02...
8,003
Posted By Muhammad Rahiz
select nth file & range of files
Two related questions;

1. how do i select the nth file in a directory?
2. how do i select a range of files, say 2nd-5th?

I have done the following but I don't think the solution is a neat one....
3,319
Posted By Muhammad Rahiz
create time sequence in bash
hi all,

hope someone can assist in this. I'm trying to make a sequence of time in bash so that the output prints the following;

1950-01-01
1950-02-01
1950-03-01
...
1999-11-01
1999-12-01
...
2,198
Posted By Muhammad Rahiz
wonderful - thanks everyone!
wonderful - thanks everyone!
2,198
Posted By Muhammad Rahiz
Thanks malikshahid85! Is there a way to...
Thanks malikshahid85!

Is there a way to print the digits as 01, 02, 03 etc instead of 1, 2, 3? I know that independently I could use printf e.g.


printf "%02d" 4


but how do i incorporate...
2,198
Posted By Muhammad Rahiz
using sed in shell script
Hi all,

I have files with the following names;
afgcxa.pem4jan.rain.nc
afgcxa.pem4feb.rain.nc
afgcxa.pem4mar.rain.nc
afgcxa.pem4apr.rain.nc

I want to rename them to...
5,828
Posted By Muhammad Rahiz
Thanks radoulov, Mind explaining what I'm...
Thanks radoulov,

Mind explaining what I'm doing here i.e. what the code/syntax means?
5,828
Posted By Muhammad Rahiz
For a start, I'd like to total from all files....
For a start, I'd like to total from all files. But I'd also like to perform other calculations like averaging etc.

Each file contains a 2000x2000 matrix. There are 1000 of such files. I'm giving a...
5,828
Posted By Muhammad Rahiz
I tried the shell method. Does not work because...
I tried the shell method. Does not work because when I compared the files, I do not get the result I expected.

For example, given a particular grid cell,

File1 (input)
131.63

File2 (input)...
5,828
Posted By Muhammad Rahiz
Thanks radoulov, Mind explaining what the...
Thanks radoulov,

Mind explaining what the following syntax means?

cat file[12]|tr '\t' '\n'|paste -sd+|bc
5,828
Posted By Muhammad Rahiz
Arithmetic: how to??
Hello all,

I'd like to know how to perform arithmetic on multiple files. I have got many tab-delimited files. Each file contains about 2000 rows and 2000 columns.

What I want to do is to to...
1,796
Posted By Muhammad Rahiz
Averaging
Hello all,

I'm trying to perform an averaging procedure which selects a selection of rows, average the corresponding value, selects the next set of rows and average the corresponding values etc.
...
3,139
Posted By Muhammad Rahiz
Thanks red dove! I just found out that it...
Thanks red dove!

I just found out that it works using 'cat'.

cat file1 file2 > file 3 # appends content of the files in a single column

Paste however, appends contents by column.

paste...
3,139
Posted By Muhammad Rahiz
Append file
Hello all,

I require assistance in combining files.
This is the scenario: I've got lots of files which contain one column in each file and would like to combine the files into one so that the...
2,054
Posted By Muhammad Rahiz
Thanks scottn!
Thanks scottn!
2,054
Posted By Muhammad Rahiz
Thanks vidyadhar85, Could you tell me what...
Thanks vidyadhar85,

Could you tell me what the syntax means?
2,054
Posted By Muhammad Rahiz
Thanks scottn, I did > grep -H...
Thanks scottn,

I did

> grep -H "WADRAIN" infile.txt > outfile.txt

and got what I wanted.

This is relatively straightforward but I also want to filter data from other columns (containing...
2,054
Posted By Muhammad Rahiz
How to filter data
Hi all,

I require assistance in this.

I'd like to filter the following data to extract WADRAIN.

RAIN, 2003-01-01 00:00, 1, WADRAIN, 900, 1, 24109, 1011, 1.6, 0, 6,
RAIN, 2003-01-01 00:00,...
Showing results 1 to 22 of 22

 
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy