![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sorting your data with msort | iBot | UNIX and Linux RSS News | 0 | 05-19-2008 11:20 AM |
| Sorting data and place them in different folders | Vinaykumar1 | UNIX for Dummies Questions & Answers | 29 | 05-14-2008 08:47 AM |
| sorting data using array in ksh | ali560045 | Shell Programming and Scripting | 4 | 12-04-2007 04:26 AM |
| Newbie Awk data sorting | i_am_a_robot | Shell Programming and Scripting | 5 | 05-04-2007 07:33 AM |
| Delete blocks with no data.. | mgirinath | Shell Programming and Scripting | 1 | 01-28-2006 06:33 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hello all,
Below is what I am trying to accomplish: I have a file that looks like this Code:
/* ----------------- xxxx.y_abcd_00000050 ----------------- */ jdghjghkla sadgsdags asdgsdgasd asdgsagasdg /* ----------------- xxxx.y_abcd_00000055 ----------------- */ sdgsdg sdgxcvzxcbv rtertwre tqwetqe xzcbvzxcb /* ----------------- xxxx.y_abcd_00000005 ----------------- */ sdgsdg sdgxcvzxcbv rtertwre tqwetqe xzcbvzxcb Code:
/* ----------------- xxxx.y_abcd_00000005 ----------------- */ sdgsdg sdgxcvzxcbv rtertwre tqwetqe xzcbvzxcb /* ----------------- xxxx.y_abcd_00000050 ----------------- */ jdghjghkla sadgsdags asdgsdgasd asdgsagasdg /* ----------------- xxxx.y_abcd_00000055 ----------------- */ sdgsdg sdgxcvzxcbv rtertwre tqwetqe xzcbvzxcb I looked up the forums but could not find anything....any suggestions? |
|
||||
|
Thanks for you response..on trying that this is the error I get
csplit: b: No such file or directory sort: open failed: xx??: No such file or directory?? Let me rephrase the question and post the actual file that needs to be sorted: Code:
/* ----------------- SVAMN14GLBSMGR.c_imds_00000060 ----------------- */ insert_job: SVAMN14GLBSMGR.c_imds_00000060 job_type: c command: script.sh par1 par2 machine: SVAMN14GLBSMGR permission: gx,wx /* ----------------- SVAMN14GLBSMGR.c_imds_00000050 ----------------- */ insert_job: SVAMN14GLBSMGR.c_imds_00000050 job_type: c command: script.sh par1 par2 machine: SVAMN14GLBSMGR permission: gx,wx /* ----------------- SVAMN14GLBSMGR.c_imds_00000055 ----------------- */ insert_job: SVAMN14GLBSMGR.c_imds_00000055 job_type: c command: script.sh par1 par2 machine: SVAMN14GLBSMGR permission: gx,wx Code:
/* ----------------- SVAMN14GLBSMGR.c_imds_00000050 ----------------- */ insert_job: SVAMN14GLBSMGR.c_imds_00000050 job_type: c command: script.sh par1 par2 machine: SVAMN14GLBSMGR permission: gx,wx /* ----------------- SVAMN14GLBSMGR.c_imds_00000055 ----------------- */ insert_job: SVAMN14GLBSMGR.c_imds_00000055 job_type: c command: script.sh par1 par2 machine: SVAMN14GLBSMGR permission: gx,wx /* ----------------- SVAMN14GLBSMGR.c_imds_00000060 ----------------- */ insert_job: SVAMN14GLBSMGR.c_imds_00000060 job_type: c command: script.sh par1 par2 machine: SVAMN14GLBSMGR permission: gx,wx |
|
||||
|
I got it to work...however I think you might have misunderstood my requirement. I need to sort blocks based on the first line. THe data within the block needs to remain the same --should not change. SO below only the items in bold are what I am concerned about...
So if I have 3 lines /---S005---/asd dfasd asdg /---S003---/erqwe dvasd xcvc /---S001---/ewrwqer dsaf xzcvxc this needs to be sorted to /---S001---/ dsaf xzcvxc /---S003---/ dvasd xcvc /---S005---/ dfasd asdg Last edited by alfredo123; 07-03-2007 at 05:15 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|