+ Reply to Thread
Results 1 to 5 of 5

Thread: How to pad spaces

  1. #1
    innofsrirm
    Guest

    How to pad spaces

    20.000 Softwares download here
    Hello,

    I have to write a function to input a Label and a number, and output a line as the following format:



    Column 1 to 30: field label, left justified.

    Column 31 to 45: A number, right justified.



    The middle is padded with space. May I know how can I achieve this? (I don't know how to count the length of the label/number, and how to pad the spaces in between.)



    Please help.



    Many thanks.



    Sarah

  2. #2
    uocmoxua87
    Guest

    In ksh you can use the typeset command:

    typeset -L30 fieldA

    typeset -R15 fieldB

    echo "${fieldA}${fieldB}"

  3. #3
    hoangbactran
    Guest

    you can also use perls format or even printf.

  4. #4
    lanuliya@gmail.com
    Guest

    Simple and beautiful.



    Many thanks

+ Reply to Thread

Similar Threads

  1. How to put spaces in a url?
    By Phu khanh in forum HTML & Website Design
    Replies: 4
    Last Post: 04-18-2009, 11:43 AM
  2. Replace spaces with +
    By bucroiday in forum Web Programming
    Replies: 4
    Last Post: 01-03-2009, 01:12 AM
  3. spaces in url's
    By sakurakhanh in forum Search Engine Optimization - SEO
    Replies: 20
    Last Post: 02-21-2007, 02:50 AM
  4. H1 and spaces
    By phuonghuy2000 in forum HTML & Website Design
    Replies: 3
    Last Post: 01-10-2006, 08:51 PM
  5. Spaces in the URL
    By denhatdao in forum Search Engine Optimization - SEO
    Replies: 20
    Last Post: 05-21-2005, 02:36 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts