The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Convert UNIX file format to PC format Samtel Shell Programming and Scripting 2 08-27-2009 06:26 PM
AWK CSV to TXT format, TXT file not in a correct column format mdap Shell Programming and Scripting 1 08-14-2008 12:03 PM
To convert multi format file to a readable ascii format gaur.deepti UNIX for Dummies Questions & Answers 5 03-25-2008 03:03 PM
Convert UTF8 Format file to ANSI format rajreddy UNIX for Dummies Questions & Answers 9 05-25-2007 09:26 AM
Convert UTF8 Format file to ANSI format rajreddy UNIX for Advanced & Expert Users 1 05-24-2007 07:40 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 11-03-2009
digipak digipak is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 19
Help me format this file

Guys, I would appreciate any help using awk or perl with the problem that I have.
I have file in following format;

1111 2222 1
3333 4444 2
5555 6666 3
7777 8888 1
9999 0000 3
1122 2233 1
3344 4455 2
5566 6677 2
7788 8899 2
9900 0011 3


and so on, the problem lies in column number 3 where data is segmented. The start of the data segment is represented by number 1 in the 3rd column and the end of the data segment is signified by number 3 in the 3rd column where as number 2 in the third column means the intermediate points between the start (1) and end (3). I have tried to represent all possible kinds that I can encounter. In simple words, I need the output to be as follows;

1111 2222 1
3333 4444 2
5555 6666 3
7777 8888 4
9999 0000 5
1122 2233 6
3344 4455 7
5566 6677 8
7788 8899 9
9900 0011 10

I would appreciate any help on this issue.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0