+ Reply to Thread
Results 1 to 5 of 5

Thread: How to pad spaces

  1. #1
    innofsrirm
    Guest

    How to pad spaces

    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

    More:


  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?
    I am trying to setup a link on my site that allows users to click on it and be directed to their twitter account and that puts text in their status...
  2. Replace spaces with +
    I need help would anybody no how to replace all the spaces within a sentence or phrase and replace them with using a code. thanks alot
  3. spaces in url's
    does google list pages with spaces in the URL's?
  4. H1 and spaces
    I don't remember how to avoid the spaces before and after Header tags. Anybody to remind me? Thanks!
  5. Spaces in the URL
    Is it bad to have spaces in the URL? I'm using a CMS and there's only so much I can do. Some of the URLs will have a space but in the URL appearing...

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!

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
Automatic Translations (Powered by Powered by Google):
Afrikaans Albanian Arabic Belarusian Bulgarian Catalan Chinese Croatian Czech Danish Dutch English Estonian Filipino Finnish French Galician German Greek Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Taiwanese Thai Turkish Ukrainian Vietnamese Welsh Yiddish