?
Solved

Field Alignment in text file

Posted on 2003-02-20
6
Medium Priority
?
165 Views
Last Modified: 2010-04-04
I'm writing a text file with different field of datas, the worst thing that I couldn't make it align at the same column for each field.  Would there be any solution to this problem?


Thank you
0
Comment
Question by:PratS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7986073
>Would there be any solution to this problem?

do yourself your textout

in which control do you display your data?
0
 

Author Comment

by:PratS
ID: 7986493
well, the text out is there! it depends on the result format and it is not list down in column as it should be.  I used spaces in between to separate them into each field.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 7986563
maybe you should explain a bit more
or show a bit code where you have the problem

if it is for a fixed textfile
i used a function like this

function filler(AString : String; ALen, ADirection : Integer) : String;
var i : integer;
begin
  result := AString;
  if AString < ALen then
  begin
    case ADirection of
      0 : begin  //left
            while result < ALen do result := result+' ';
          end;
      1 : begin  //center
            while result < ALen do
            begin
              result := result+' ';
              if result < ALen then
                result := ' ' + result;
            end;
          end;
      2 : begin  //right
            while result < ALen do result := ' '+result;
          end;
    end;
  end;
end;

you can now call this like

s := filler('ABC',10,0);

well, just from head
-> not tested

meikl ;-)
 
0
 

Expert Comment

by:CleanupPing
ID: 9317168
PratS:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9928633
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept kretzschmar's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question