The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > HP-UX
.
google unix.com



HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Padding with zeros. sbasetty Shell Programming and Scripting 10 05-18-2009 07:09 PM
Help needed in padding leading zeros jakSun8 Shell Programming and Scripting 12 07-02-2008 07:41 PM
Removing leading zeros from a variable toshidas2000 Shell Programming and Scripting 6 02-27-2008 01:13 PM
Removing empty spaces and adding commas jazz High Level Programming 4 11-13-2006 09:54 AM
removing commas from text file hcclnoodles UNIX for Dummies Questions & Answers 6 03-26-2003 04:43 PM

Closed Thread
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
  #1 (permalink)  
Old 11-09-2005
pranag21 pranag21 is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 1
Padding zeros after removing commas in file

Hi Gurus,

There is a ASCII file in which a comma is used as a seperator for the amount field when the amount exceed seven digits: e.g. 0001300,000. Now, this comma needs to be removed from this field, after padding leading zeros (to maintain the ASCII positions) e.g. 00001300000. Could anyone post a detailed solution which can handle this requirement?. There are multiple records in the file which fall under this category.


Thanks for your help

Prakash
Attached Files
File Type: doc commas.doc (29.0 KB, 21 views)
  #2 (permalink)  
Old 11-09-2005
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,407
This is gnu sed....
Code:
$ echo "0001300,000" | sed -r 's/([0-9]{7}),([0-9]{3})/0\1\2/'
00001300000
Closed Thread

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:33 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