No subject


Sat Oct 14 20:46:50 EDT 2006


limit on file size) and find out how long the lines are. Then I upload the
file to the AS/400 using client access' file transfer funcion (this is
where I input the lenght of the lines). It says it has support for CSV
files, but it doesn't work correctly.

For some odd rason the AC/400 puts 12 numbers in front of each line, it
looks something like this:

000100000000LAST NAME       FIRST NAME

If that didn't happen I would do 99% of my work on a linux box, but
because of that I now need to load up some custom software that was
written in house and put in the start of each field that we need, and the
length.. For example, the one I just did looks like this:

FN - 35 - 15 (First Name, starts at 35, and is 15 chars long)
LN - 13 - 22 (Last Name, starts at 13 and is 22 chars long)

Then it gets converted into our own format that doesn't have those stupid
junk numbers in front of it where it later gets turned into labels.


>> > 	Putting data out in a formatted setup is easy once you know the max
>> length of the record.  I understand that you want to figure out the max
>> length of each entry in each field and then add one - you can do this
>> one of two ways.  Read the entire thing into memory (does not scale for
>> large files) or iterate over the file twice and just mark the maximum
>> length.  Anyone else have a better idea on how to find the max length of
>> a field in a CSV file?
>
> That is correct. It's easy to say each field is say 30 chars long, but
> sometimes we get data that has fields that are 60 or even 80 and we need
> the whole thing, other times we get a bunch of tiny ones that are only 1
> or 2 and that just sucks up space (yes, space is that tight)
>
>> #data is in 3 ordered arrays - get the real data in here..
>> #this is just an example.
>> my @first = ('first', 'names', 'here');
>> my @last = ('last', 'names', 'here');
>> my @emails = ('email', 'addresses', 'here');
>
> Let me just add that it's not always 3 fields, it could be up to 30.
> Naming them is not needed.
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss
>




More information about the gnhlug-discuss mailing list