move content from one file to another


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting move content from one file to another
# 1  
Old 11-27-2011
move content from one file to another

i have a file like:
Code:
COURSE NAME: operating systems
CREDITS:4
123456  66
234567  80
567892  64
COURSE NAME: C#
CREDITS: 5
123456  67
345688  95
234567  78
COURSE NAME: Java
CREDITS: 4
245562  88
123456  93
278962  95
COURSE NAME: Oracle
CREDITS:5
278962  86
345675  99

123456,234567 are ID's and 66,80,64 are total
i want to move total to another file which is like
Code:
Student#      Operating Systems      C#      Java      Oracle      GPA
123456
234567
245562
278962
345675
345688
567892

how can i do this Smilie

Last edited by zaxxon; 11-28-2011 at 10:27 AM.. Reason: code tags
# 2  
Old 11-28-2011
I didn't get your question. Could you please be a bit more clearer? What is the exact output you require?
# 3  
Old 11-28-2011
i want output like this:
Student# Operating Systems C# Java Oracle GPA
123456 66 67 93 -
234567 80 78 - -
245562 - - 88 -
278962 - - 95 82
345675 - - - 99
345688 - 95 - -
567892 64 - - -
# 4  
Old 11-28-2011
Not Clear still. Always use the quote & code tags for better formatting.
# 5  
Old 11-28-2011
i want output like this:
Student# OperatingSystems C# Java Oracle GPA
123456 66 67 93 -
234567 80 78 - -
245562 - - 88 -
278962 - - 95 82
345675 - - - 99
345688 - 95 - -
567892 64 - - -

---------- Post updated at 09:07 AM ---------- Previous update was at 09:04 AM ----------

Quote:
Originally Posted by poonam29
i want output like this:
Student# OperatingSystems C# Java Oracle GPA
123456 66 67 93 -
234567 80 78 - -
245562 - - 88 -
278962 - - 95 82
345675 - - - 99
345688 - 95 - -
567892 64 - - -
---------- Post updated at 09:13 AM ---------- Previous update was at 09:07 AM ----------
Quote:
Originally Posted by poonam29
i want output like this:
Quote:
Originally Posted by poonam29
Student# OperatingSystems C# Java Oracle GPA
123456 66 67 93 -
234567 80 78 - -
245562 - - 88 -
278962 - - 95 82
345675 - - - 99
345688 - 95 - -
567892 64 - - -

---------- Post updated at 09:07 AM ---------- Previous update was at 09:04 AM ----------
# 6  
Old 11-28-2011
That's the 3rd? time you try to post your homework questions - you made it to the homework sub forum without reading how to post there correctly and getting no answer you are just back here? No way. You will be set to read only for a month - should be enough time to read the forum rules.

Here are the Forum Rules - you should read them and obeye, also use code tags etc.

Last edited by zaxxon; 11-28-2011 at 10:38 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Move a TXT file greater or equal 355 MB with its corresponding .LST file

Good morning, i need your help please I need to move a .TXT file greater or igual 355 MB and its correspondent .LST file in a non recursive way The operating system is: uname -a SunOS server01c 5.10 Generic_144488-01 sun4u sparc SUNW,SPARC-Enterprise For example: rw-r--r-- 1 xptol ... (8 Replies)
Discussion started by: alexcol
8 Replies

2. Shell Programming and Scripting

How can i move folders and its content if folder is older than 1,5 days and keep subdirs in bash?

Hello all, do you know any way i can i move folders and its content if folder is older than 1,5 days in bash? I tried: find /home/xyz/DATA/* -type d -ctime +1.5 -exec mv "{}" /home/xyz/move_data_here/ \;All i got was that Files from DATA /home/xyz/DATA/* ended messed up in... (1 Reply)
Discussion started by: ZerO13
1 Replies

3. Shell Programming and Scripting

Move multiple files 4rm Source to different target folders based on a series num in the file content

Dear Experts my scenario is as follows... I have one source folder "Source" and 2 target folders "Target_123456" & "Target_789101". I have 2 series of files. 123456 series and 789101 series. Each series has got 3 types of fiels "Debit", "Refund", "Claims". All files are getting... (17 Replies)
Discussion started by: phani333
17 Replies

4. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

5. Shell Programming and Scripting

Sorting content between match pattern and move on with awk and sed

S 0.0 0.0 (reg, inst050) k e f d c S 0.0 0.0 (mux, m030) k g r s x v S 0.0 0.0 (reg, inst020) q s n m (12 Replies)
Discussion started by: ctphua
12 Replies

6. Shell Programming and Scripting

Sed: replace content from file with the content from file

Hi, I am having trouble while using 'sed' with reading files. Please help. I have 3 files. File A, file B and file C. I want to find content of file B in file A and replace it by content in file C. Thanks a lot!! Here is a sample of my question. e.g. (file A: a.txt; file B: b.txt; file... (3 Replies)
Discussion started by: dirkaulo
3 Replies

7. Shell Programming and Scripting

Remove bad records from file and move them into a file then send those via email

Hi my requirement is that i want pull the bad records from input file and move those records in to a seperate file. that file has to be sent via email.. any suggentions please (1 Reply)
Discussion started by: sxk4999
1 Replies

8. UNIX for Dummies Questions & Answers

move a file content to another directory

my script is: /u/user/orginal/:#! /bin/ksh find . -name "aur_prog*" -exec grep -il "error" > test.out #awk command to destination directory exit test.out file contain: ./aur_prog1.log ./aur_prog2.log ... (5 Replies)
Discussion started by: roughwal
5 Replies

9. UNIX for Dummies Questions & Answers

Move content from directory to another

I have in root directory a folder A and a Folder B. I want to copy or move all content (many files) from A to B. How do I do that UNIX style? Thanks! (6 Replies)
Discussion started by: Matsakii
6 Replies

10. Shell Programming and Scripting

move contents from one file to another based on line number or content

I want a script that will move everything beyond a certain line number or beyond a certain content word into another file. For example, if file A has this: first line second line third line forth line fifth line sixth line I want to run a script that will move everything beyond the third... (4 Replies)
Discussion started by: robp2175
4 Replies
Login or Register to Ask a Question