![]() |
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 |
| AWK Formatting Problem | cstovall | Shell Programming and Scripting | 2 | 11-30-2007 10:53 PM |
| rare problem -reinstalling formatting nothing is working | simaich8 | Linux | 0 | 11-04-2007 02:07 AM |
| Formatting problem | skyineyes | Shell Programming and Scripting | 9 | 07-03-2007 10:11 AM |
| Problem in Formatting File | Dhruva | Shell Programming and Scripting | 1 | 04-11-2006 09:50 AM |
| Problem re-formatting Disk Partition | jimthompson | UNIX for Dummies Questions & Answers | 1 | 01-11-2006 07:06 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Formatting Problem
Hi
Suppose we have a file consisting of nos in following format 123 - 789 123 - 828 345 - 989 345 - 792 I require the following output 123, 789,828 345, 989,792 Means Unique nos in 1st Column and Corresponding two nos in comma separated 2nd Column Please help me out... |
|
|||||
|
Quote:
Quote:
Code:
path_to_script < INPUTFILE Quote:
Code:
fld1=${iLine%%-*}
fld2=${iLine#*-}
Quote:
Code:
if [ "$fld1" = "$savefld1" ]; then[/QUOTE] Last edited by vgersh99; 03-19-2007 at 12:07 AM.. |
|
|||||
|
Thank you for your information, cfajohnson.
I was just trying to help Pradeepred solve his problem. We all know that there are innumerous ways to solve a problem in unix. For the past 26 years, I have been working for several companies where, the four most important things are: 1- To get the job done. 2- It does not break. 3- It is easy to understand. 4- It is easy to maintain it. Again, I was just sincerely trying to help Pradeepred. Sorry if I broke any rule writing any code that is not considered POSIX shell script. Best regards, Marcos Last edited by Shell_Life; 03-16-2007 at 08:57 AM.. Reason: Remove original quoted message. |
|
|||||
|
Quote:
Quote:
Every *nix system has a POSIX shell, but it may not be bash or ksh93. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|