Need help to padding the word to create flat files

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2006
Posts: 13
Reputation: madankumar is an unknown quantity at this point 
Solved Threads: 0
madankumar madankumar is offline Offline
Newbie Poster

Need help to padding the word to create flat files

 
0
  #1
Dec 19th, 2007
HI

I would likt to create input files for testing, format is like this

INPUT Format

DISP NUM BYTES Desc
0 4 CODE
4 10 EMP NO
14 3 AGE
17 1 SEX

which will be used for creating flat files ( data in excel file).

OUTPUT file should be continous like

CODE19239625M

like this

Here CODE is the EMPCODE, 192396 is EMPNO, 25 is the AGE and M is SEX.

Can anyone will lead me to write the script ......... PLZ help
Madan Kumar T
Bangalore.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,416
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 257
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Need help to padding the word to create flat files

 
0
  #2
Dec 19th, 2007
Check out the man pages for printf.
Last edited by masijade; Dec 19th, 2007 at 8:23 am. Reason: typo
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC