The problem was that when I captured the command in the history it chucked that thing out. Another reason against csh!!!
---------- Post updated at 06:04 AM ---------- Previous update was at 05:49 AM ----------
I have tried
Code:
grep "!" radon3d_subs.f90 | sed 's/.*\! //'
on the following
Code:
!!
!! SUB radon3d_temporal_fourier
subroutine radon3d_temporal_fourier( tcube, fcube, c_dir )
implicit none
! Arguments
real, dimension(:,:,:), intent(in) :: tcube
complex, dimension(:,:,:), intent(in) :: fcube
character(len=*), intent(in) :: c_dir
! Local variables
real, dimension(:), allocatable :: ft ! stores a single trace
real, dimension(:), allocatable :: tr ! stores a single trace (extended to size of ft)
! IMPLEMENTATION ---------------------------------------------------------------------------------
nt = size(tcube,1)
nx = size(tcube,2)
ny = size(tcube,3)
nf = size(fcube,1)
! trace in the frequency domain
allocate( ft(nf) )
! trace extended to size(ft)
allocate( tr(nf) )
!!> SELECT TRANSFORMATION DIRECTION
select case ( c_dir(1:1) )
!!> time to frequency
case ('+')
do iy = 1, ny
do ix = 1, nx
tr(nf) = 0.0 !!> ensures last sample is zero when nf > nt
tr(1:nt) = (tcube(1:nt,ix,iy)
ft = cfft(tr, '+')
fcube(1:nf,ix,iy) = ft(1:nf)
enddo
enddo
!!> frequency to time
case ('-')
do iy = 1, ny
do ix = 1, nx
ft(1:nf) = fcube(1:nf,ix,iy)
tr = cfft(ft, '-')
tcube(1:nt,ix,iy) = tr(1:nt) !!> nt may be smaller than nt
enddo
enddo
case default
! do nothing
end select
and I am getting
Code:
SUB radon3d_temporal_fourier
Arguments
Local variables
stores a single trace
stores a single trace (extended to size of ft)
IMPLEMENTATION ---------------------------------------------------------------------------------
trace in the frequency domain
trace extended to size(ft)
!!> SELECT TRANSFORMATION DIRECTION
!!> time to frequency
tr(nf) = 0.0 !!> ensures last sample is zero when nf > nt
!!> frequency to time
tcube(1:nt,ix,iy) = tr(1:nt) !!> nt may be smaller than nt
do nothing
Almost correct. There is a problem that the match in sed
Code:
grep "!" radon3d_subs.f90 | sed 's/.*\! //'
removes the '!'
---------- Post updated at 06:44 AM ---------- Previous update was at 06:04 AM ----------
I tried the following
Code:
!!
!! SUB radon3d_temporal_fourier
! Arguments
! Local variables
real, dimension(:), allocatable :: ft ! stores a single trace
real, dimension(:), allocatable :: tr ! stores a single trace (extended to size of ft)
! trace in the frequency domain
! trace extended to size(ft)
!!> SELECT TRANSFORMATION DIRECTION
!!> time to frequency
tr(nf) = 0.0 !!> ensures last sample is zero when nf > nt
!!> frequency to time
tcube(1:nt,ix,iy) = tr(1:nt) !!> nt may be smaller than nt
! do nothing
Code:
grep "!" radon3d_subs.f90 | sed 's/(.*)(!.*)/\2/'
This produces the following. As you can see when I have '!!', these are changed to
a single '!'. How can I modify this so I get '!!'?
Code:
! SUB radon3d_temporal_fourier
! Arguments
! Local variables
! stores a single trace
! stores a single trace (extended to size of ft)
! trace in the frequency domain
! trace extended to size(ft)
!> SELECT TRANSFORMATION DIRECTION
!> time to frequency
!> ensures last sample is zero when nf > nt
!> frequency to time
!> nt may be smaller than nt
! do nothing
hi
In the foll example the whole text in a single line....
i want to extract text from IPTel to RTCPBase.h.
want to use this acrooss the whole file
Updated: IPTel\platform\core\include\RTCPBase.h \main\MWS2051_Sablime_Int\1... (7 Replies)
Hi,
I have file 1.txt with following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433
**
**
**
In file 2.txt I have the following entries as shown:
0152364|134444|10.20.30.40|015236433
0233654|122555|10.20.30.50|023365433... (4 Replies)
-Hi
I have multiple files which contain a line with the word "exec". I need to add the following pattern " -cmode -ccheap" on the same line where "exec" is at the end. Any idea? Thanks a lot in advance to everybody... -A (2 Replies)
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Hi All,
I am pretty new to pattern matching and extraction using shell scripting. Could anyone please help me in extracting the word matching a pattern from a line in bash.
Input Sample (can vary between any of the 3 samples below):
1) Adaptec SCSI RAID 5445
2) Adaptec SCSI 5445S RAID
3)... (8 Replies)
I have a file with hundreds of records and I need to find those records that have three digits at the beginning and the same three digits at the end.
$GREP '\(\)\(\)\(\)\3\2\1'I
believe this is part of the script but I am not sure how to compare these 3 digits with the 3 digits at the end of... (2 Replies)
I have some data as below. I need correct it as result.
Data:
BG1:100+10++II
DG1:200+100+1234
DG2:300+200++II
CG1:200+100+1111
DG2:400+100++II
DG6:200+200+2345
DG2:400+100+2222
Result:
BG1:100+10++II
DG1:200+100+1234
DG2:300+200++1
CG1:200+100+1111
DG2:400+100++1... (4 Replies)
Hi,
I want to match the pattern in file1 with file2 and print the value in file2 and paste in file1
file1:
ISHO RT SR Major 96.46778
Drop Call Rate CS Critical 0.5072662
ISHO RT SR Major 97.754364... (3 Replies)
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Hi Gurus,
I have a file as follows (Sample shown below but the list is very huge)
SCHEDULE WS1#JS1
RUNCYCLE1
:
WS1#JOB1
WS1#JOB2
FOLLOWS JOB1
END
SCHEDULE WS2#JS1
RUNCYCLE2
:
WS1#JOB3
WS1#JOB1
FOLLOWS JOB3
WS2#JOB1 (10 Replies)