Subject Re: [firebird-support] Re: Looking for a fast solution for loading data from a text file into Firebird
Author Milan Babuskov
vladman992000 wrote:
>> I don't think external tables can work with non fixed width files at
>> all, but I might be wrong.
>> Is it a Windows environment?
>
> No, its Linux.
>
>> I'm sure such a file could be padded in "no-time" with a small util. It
>> could be executed automatically when a new file is uploaded. I could
>> write you such an util, except the "auto run" feature, which would take
>> me too long to figure out.
>
> I'm just installing Lazarus/Free Pascal on Linux and I'll write a
> small command line utility to do this.

What an overkill. If you use Linux, use the power of it's command line
tools. Here's a one-liner that does what you need (pad to 100 chars):

awk '{ printf("%-100.100s\r\n",$0) }' < inputfile.txt > outputfile.txt



--
Milan Babuskov
http://www.flamerobin.org
http://www.guacosoft.com