Script to access multiple file and operate on single file
We have three files as mentioned below: 1.main_file.txt: This is the file in which all operations will be done. Which means this file will be signed by using the below two files 2.signature_file.txt:This is a status file and contains two signatures. 3.command.txt:file contains two commands which needs to be performed on main_file.txt as mentioned above. main_file.txt looks like below: signature_file.txt looks like below:
Command.txt file looks like below:
Now the script should do the following operation.
1. Insert a new line in the end of the main_file.txt 2. Pick the first signature (line 1) of the signature file and put it in the end of the main_file.txt 3. Insert a new line in the end of the main_file.txt 4. Pick the first command from the command.txt file and run it. 5. This command will generate a text output. Put that text output in the end of the main_file.txt. 6. Insert a new line in the end of the main_file.txt 7. Pick the second signature (line1) of the signature file and put it in the end of the main_file.txt 8. Insert a new line in the end of the main_file.txt 9. Pick the second command from the command.txt file and run it. 10. This command will generate a text output. Put that text output in the end of the main_file.txt. (No new line insertion after this point).
Can anybody help me in getting this sorted? I am at the loss as how to achieve this?
Dear all
I need a script for multiple find and replace in a single file.
For example input file is -
qwe wer ert rty tyu
asd sdf dgf dfg fgh
qwe wer det rtyyui
jhkj ert asd asd dfgd
now
qwe should be replace with aaaaaa
asd should be replace with bbbbbbbb
rty should be replace... (6 Replies)
Hi,
I have a file that consist of around six million line, now the task is to divide this file into 12 small file so that each file would have half a million lines in it.
Thanks. (3 Replies)
Hi friends
please help me on below,
i have 5 files like below
file1 is
x 10
y 20
z 15
file2 is
x 100
z 245
file3 is
y 78
z 23
file4 is
x 100 (3 Replies)
hdr=$(cut -c1 $path$file|head -1)#extract header”H”
trl=$(cut -c|path$file|tail -1)#extract trailer “T”
SplitFile=$(cut -c 50-250 $path 1$newfile |sed'$/ *$//' head -1')# to trim white space and extract table name
If; then # start loop if it is a header
While read I #read file
Do... (4 Replies)
Hi Team,
In our project we have written below 2 scripts like
Script1:
Shell script start & END
Begin Audit process - uses teradata bteq
END Audit Process
Script 2: Environemtal variable file different
Now Client ask to change this requirement and need below files:
Script1:... (1 Reply)
Hi Experts,
I am querying backup status results for multiple databases and getting each and every database result in one csv file. so i need to combine all csv files in one excel file with separate tabs. I am not familiar with perl script so i am using shell script.
Could anyone please... (4 Replies)
I am trying to consolidate multiple information files (<hostname>.Linux.nfslist) into one file so that I can import it into Excel. I can get the file contents with cat *Linux.nfslist >> nfslist.txt. I need each line prefaced with the hostname. I am unsure how to do this.
--- Post updated at... (5 Replies)