Copying Information from One File to Another File in Shell
Hello, I'm new to scripting and I need help moving text from one file to another file. Here are examples what the files look like.
File 1:
File 2:
I need to copy information from the second file into the first file. At the end of each line that lists the nuclide (ex: Ac-223 and Ac-224) is a number (ex: 480 or 682). I need to copy that number from file 2 and insert it into file 1 after the 4th column (1, 482, 1165, etc) in it's own separate column. I need to do that for each line in file 1.
Additionally, I have a third file that I need to extract information from and place in file 1. Here is an example of file 3:
I need to copy the number at the end of the line with the nuclide in it and paste it after the 5th column in the index file (0, 0, 0, 1). But this is only pasted in if there is 'B-' in the third column, otherwise I need it to list 0.
So, here's an example of what I would want it to look like, I have bolded the added information:
Hi,
I want to write a program to copy a log file to Excel sheet. Excel sheet has four columns MethodName , Code , Description, Details and Time.
I want to pick these info from text file and put it in excel sheet.
here is how the text file looks -
04.17.2014 08:06:12,697... (1 Reply)
Hello everyone
I am completely new to shell scripting in linux. I wan to write a script to search for a certain string from a .txt file and copy the string which apears just after tat searched string.
Eg: in a file- try.txt , we have a line saying: "roses are red, so what do i do"
I... (4 Replies)
vat.log
--------
null
null statistics
null
null
null
Storage Response Time
disk space1
disk space2
I have a log as mentioned above in which I need to copy only the below content to another file using shell scripting. In between null statistics and final null it also includes... (1 Reply)
Hi,
TASK 1:
I have been using this code to print the information of files kept at "/castor/cern.ch/user/s/sudha/forPooja" in some text file name FILE.txt.
rfdir /castor/cern.ch/user/s/sudha/forPooja | grep data | awk '{print "rfio:///castor/cern.ch/user/s/sudha/forPooja/"$9}' > FILE.txt
... (6 Replies)
Hi to all,
I got this content/pattern from file http.log.20110808.gz
mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1
mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU
mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Hi to all,
anyway to create shell script to sort informations from one file and create new file with the sorted values?
from file 30days.out
-bash-3.00# more 30days.out
user/str4@kl.com/INBOX
user/tg1@johor.com/INBOX
user/tg2@kedah.com/INBOX
user/tg3@titangroup.com/INBOX... (3 Replies)
Hi guys, I am a newbie here :wall:
I need a script that can search for a file in a directory and copy the contents of that file in a new file.
Please help me. :confused: Thanks in advance~ (6 Replies)
We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>"
FILE1.XML
1. <itemList>
2. <item type="Manufactured">
3. <resourceCode>431048</resourceCode>
4. ... (0 Replies)
Hi, Im trying to take a database backup. one of the files is 26 GB. I am using cp -pr to create a backup copy of the database. after the copying is complete, if i do du -hrs on the folders i saw a difference of 2GB.
The weird fact is that the BACKUP folder was 2 GB more than the original one!
... (1 Reply)