How would I delete everything on a line in a file prior to a specific word?
In other words, I have a file that contains the word SEARCH on various lines and would like to delete everything prior to SEARCH on all lines. Thanks for that help (2 Replies)
Hi I have a text file like this name today.txt
the request has been accepted
the scan is successful at following time
there are no invalid packages
5169378 : map : Permission Denied
the request has been accepted
Now what i want do is
I want to search the today.txt file and
if i... (1 Reply)
Hi Canone please provide me solution how can achieve the result below:
File1.txt
$
sweet appleŁ1
scotish
green
$
This is a test1
$
sweet mangoŁ2
asia
yellow
$
This is a test 2
$
sweet apple red (there is no pound symbol here)
germany
green (1 Reply)
write a shell script that deletes all lines containing a specified word in one or more files supplied as arguments to it.help is appreciated .thank you. (2 Replies)
I'm new to using sed and grep commands, but have found them extremely useful. However I am having a hard time figuring this one out:
Delete every line containing the word CEN and the next line as well.
ie. test.txt
blue
324 CEN
green
red
blue
324 CEN
green
red
blue
to produce:... (2 Replies)
I have a line that gets pulled from a database that has a variable number of fields, fields can also be of a variable size. Each field has a variable number of spaces between them so there is no 'defined' delimiter. The LastData block is always a single word.
What I want to do is delete the... (2 Replies)
Hi,
I have gone through may posts and dint find exact solution for my requirement.
I have file which consists below data and same file have lot of other data.
<MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'>
<MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
I want to delete the last word of each line in all the files in one directory but dont know what I am doing wrong
FILES="data/*"
for X in $FILES
do
name=$(basename $X)
sed s/'\w*$'// $X > no-last/${name}
done
Can you please help me :wall: (8 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Hi Guys ,
I am having a file as stated below
File 1
sa0 -- i_core/i_core_apb/i_afe0_controller/U261/A
sa0 -- i_core/i_core_apb/i_afe0_controller/U265/Z
sa1 -- i_core/i_core_apb/i_afe0_controller/U265/A
sa1 -- i_core/i_core_apb/i_afe0_controller/U268/Z
sa1 -- ... (7 Replies)
Discussion started by: kshitij
7 Replies
LEARN ABOUT BSD
struct
STRUCT(1) General Commands Manual STRUCT(1)NAME
struct - structure Fortran programs
SYNOPSIS
struct [ option ] ... file
DESCRIPTION
Struct translates the Fortran program specified by file (standard input default) into a Ratfor program. Wherever possible, Ratfor control
constructs replace the original Fortran. Statement numbers appear only where still necessary. Cosmetic changes are made, including chang-
ing Hollerith strings into quoted strings and relational operators into symbols (.e.g. ".GT." into ">"). The output is appropriately
indented.
The following options may occur in any order.
-s Input is accepted in standard format, i.e. comments are specified by a c, C, or * in column 1, and continuation lines are specified
by a nonzero, nonblank character in column 6. Normally input is in the form accepted by f77(1)-i Do not turn computed goto statements into switches. (Ratfor does not turn switches back into computed goto statements.)
-a Turn sequences of else ifs into a non-Ratfor switch of the form
switch
{ case pred1: code
case pred2: code
case pred3: code
default: code
}
The case predicates are tested in order; the code appropriate to only one case is executed. This generalized form of switch state-
ment does not occur in Ratfor.
-b Generate goto's instead of multilevel break statements.
-n Generate goto's instead of multilevel next statements.
-tn Make the nonzero integer n the lowest valued label in the output program (default 10).
-cn Increment successive labels in the output program by the nonzero integer n (default 1).
-en If n is 0 (default), place code within a loop only if it can lead to an iteration of the loop. If n is nonzero, admit a small code
segments to a loop if otherwise the loop would have exits to several places including the segment, and the segment can be reached
only from the loop. `Small' is close to, but not equal to, the number of statements in the code segment. Values of n under 10 are
suggested.
FILES
/tmp/struct*
/usr/libexec/struct/*
SEE ALSO f77(1)BUGS
Struct knows Fortran 66 syntax, but not full Fortran 77.
If an input Fortran program contains identifiers which are reserved words in Ratfor, the structured version of the program will not be a
valid Ratfor program.
The labels generated cannot go above 32767.
If you get a goto without a target, try -e .
7th Edition October 22, 1996 STRUCT(1)