Append text from one file to another based on a search from the end of a document
Hi all,
I have output files that are all text files with various different extensions.
So, if I submit the input file "job_name.inp", when it finishes I get an output file "job_name.dat". A typical input file looks something like this:
To run other types of jobs, I need to extract and append a portion of text that is in the "job_name.dat" file directly at the end of the text in the "job_name.inp" file directly below the "$END".
The text that needs to be appended is sandwiched between a line that contains only "$HESS" (which indicates the begining of the block of text that needs to be appended) and a line that contains only "$END".
Here is a shortened version of what it looks like:
The trouble is that there are a number of these blocks of text that are delineated by "$HESS" and "$END".
The number of "$HESS" blocks of text varies between files unfortunately. The correct block is the very last one in the "job_input.dat" file.
Is there a way to use maybe awk for this but search backwards from the end of the document up?
Hi All,
I have two comma separated value(CSV) files, say FileA and FileB.
The contents looks like that shown below.
FileA
EmpNo,Name,Age,Sex,
1000,ABC,23,M,
1001,DES,24,F, ... (2 Replies)
Hi
I need to append some text @ end of the first line in a file.
like
myfile.txt
list = a,b,c
list.a=some..
I give the arg "d" . now it append at end of first line
list=a,b,c,d
list.a=some...
Please help me out this (7 Replies)
Hi,
I have a command "get_data" with some parameters in few *.text files of a directory. I want to first find those files that contain this command and then append the following parameter to the end of the command.
example of an entry in the file :-
get_data -x -m50 /etc/web/getid
this... (1 Reply)
Hi All,
Please tell me how to append some text message at the end of the file.
"File too large to view"
example: xyz.log contains
hhhhhhhhhhh
hhhhhhjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjj
"File too large to view"
Please advice (3 Replies)
I have a file "sample.txt" with the content as below:
Hi
This is a Sample Text.
I need a single command using cat which serve the following purpose.
1.display the contents of sample.txt
2.append some text to it
3. and then exit
But, all should be served by a sinle command.:confused: (1 Reply)
Hi folks,
Using shell, I am trying the append comma to every line of text.
the requirement is like, I have to open the txt file in unix and read line by line and should add comma at the end of every word to make it single line
txt file
-------
abc@gmail.com
bcd@gmail.com... (7 Replies)
I have 2 files that I am working with
$ cat file1
server1
server3
server5
server6
server8
$ cat file2
server1;Solaris;
server2; SLES;
server3;Linux;
server4; Solaris;
server5;SLES;
server6;SLES;
server7;Solaris;
server8;Linux; (1 Reply)
Hi guys,
I need to append new data at the end of each line of the files. This new data is based on substring (3rd fields) of last column.
Input file xxx.csv:
U1234|1-5X|orange|1-5X|Act|1-5X|0.1 /sac/orange 12345 0
U5678|1-7X|grape|1-7X|Act|1-7X|0.1 /sac/grape 5678 0... (5 Replies)
Hello,
i hope the titel is okay.
I want to edit a line in
/etc/arno-iptables-firewall/firewall.conf
So the Line can contains:
OPEN_TCP="436, 25, 80, 110, 143, 443, 465, 587, 993, 995, 21, 20"
i want to search in this line:
OPEN_TCP="*, *, 80, *, *, 443, *, *, *, *"
and i want to... (11 Replies)
Hi All-I am new to Unix , I need to write a script. Can someone help me with a requirement where I have list of files in a directory, I want to Merge the files if a pattern of string matches in filenames?
AAAL_555A_ORANGE1_F190404.TXT
AAAL_555A_ORANGE2_F190404.TXT
AAAL_555A_ORANGE3_F190404.TXT... (6 Replies)
Discussion started by: Shankar455
6 Replies
LEARN ABOUT DEBIAN
tau_profile_set_context
TAU_PROFILE_SET_CONT(3) TAU Instrumentation API TAU_PROFILE_SET_CONT(3)NAME
TAU_PROFILE_SET_CONTEXT - Informs the measurement system of the context id
SYNOPSIS
C/C++:
TAU_PROFILE_SET_CONTEXT(int context);
Fortran:
TAU_PROFILE_SET_CONTEXT(integer context);
DESCRIPTION
The TAU_PROFILE_SET_CONTEXT macro sets the context identifier of the executing task for profiling and tracing. Tasks are identified using
context, context and thread ids. The profile data files generated will accordingly be named profile.<context>.<context>.<thread>. Note that
it is not necessary to call TAU_PROFILE_SET_CONTEXT when using the TAU MPI wrapper library.
EXAMPLE
C/C++ :
int main (int argc, char **argv) {
int ret, i;
pthread_attr_t attr;
pthread_t tid;
TAU_PROFILE_TIMER(tautimer,"main()", "int (int, char **)",
TAU_DEFAULT);
TAU_PROFILE_START(tautimer);
TAU_PROFILE_INIT(argc, argv);
TAU_PROFILE_SET_NODE(0);
TAU_PROFILE_SET_CONTEXT(1);
/* ... */
TAU_PROFILE_STOP(tautimer);
return 0;
}
Fortran :
PROGRAM SUM_OF_CUBES
integer profiler(2) / 0, 0 /
save profiler
INTEGER :: H, T, U
call TAU_PROFILE_INIT()
call TAU_PROFILE_TIMER(profiler, 'PROGRAM SUM_OF_CUBES')
call TAU_PROFILE_START(profiler)
call TAU_PROFILE_SET_NODE(0)
call TAU_PROFILE_SET_CONTEXT(1)
! This program prints all 3-digit numbers that
! equal the sum of the cubes of their digits.
DO H = 1, 9
DO T = 0, 9
DO U = 0, 9
IF (100*H + 10*T + U == H**3 + T**3 + U**3) THEN
PRINT "(3I1)", H, T, U
ENDIF
END DO
END DO
END DO
call TAU_PROFILE_STOP(profiler)
END PROGRAM SUM_OF_CUBES
SEE ALSO TAU_PROFILE_SET_NODE(3)
08/31/2005 TAU_PROFILE_SET_CONT(3)