![]() |
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 |
| change order of fields in header record | JohnMario | UNIX for Dummies Questions & Answers | 1 | 05-22-2008 02:58 PM |
| How count number of fields in a record | sureshg_sampat | Shell Programming and Scripting | 5 | 01-07-2008 06:30 AM |
| splitting a record and adding a record to a file | rsolap | Shell Programming and Scripting | 1 | 08-13-2007 01:58 PM |
| awk: record has too many fields | chaandana | Shell Programming and Scripting | 3 | 07-29-2005 01:03 PM |
| How to screen each variable record for right # of fields | jvander | Shell Programming and Scripting | 3 | 04-27-2005 10:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Manipulating fields record wise
Hi all,
I have an input file with no delimiter. Let us say the file is abc.txt having values for fields namely, EmpNumEnameDesigSalDept. Ofcourse the file has got several records. Every field has got a fixed start and end position. I need to assign the fields to corresponding varibles say EmpNum, Ename, Desig, Sal and Dept. Now if Dept is more than 10 and less than 15, then I have to give the 20% increment in Salary, or if Dept is more than 15, then I have to give the 30% increment in Salary. Again, for a particular Dept I need to check if the Designation is Manger. Once a record meets the above condtions, I need to pick the fields for that record and put them all (or selective fields only) in a separate file. Then I will move to the next record and so on. Thanks in advance for resolving the issue. Regards, Rin.. ![]() |
|
|||||
|
Sounds suspisciously like homework... if so, you are violating rule 6 of this forum. Check the rules here.
Anyways, a few pointers. To get the individual fields from the file use the cut command. Check the man page for details. You can do the math using the ksh builtins or expr if you are going to be using sh/csh. I am sorry, but I won't be getting any more specific. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|