jazzlover has asked for the wisdom of the Perl Monks concerning the following question:
example :- (access or excel file)
headers at top of first row i.e
name,address,postcode,mobile,
pat,50 car road,aa1 1ab,99999
patr,100 car av,bb1 1bb,88888
the details below are in each column. say about 1000 records
i need this data to be formated so that i can read it so that each record is padded out to the max length for each field and stays in its relevant spacing.
Example
name address postcode mobile
pat 50 car road aa1 1ab 99999
patr 100 car av bb1 1bb 88888
The above example is not showing it well but say the name field is longest 15 characters i need that field to be 15 long for the rest of the file, if address is longest of 24 then it needs to be 24 long for the rest of the file. Hope this makes sence.
Ideally ive got to create an output that shows it as follows :-
name: pat
address : 50 car road
postcode : aa1 1ab
mobile : 99999
name: patr
address : 100 car av
postcode : bb1 1bb
mobile : 88888
Would love some type of help on this for both parts that are needed. I hope ive explained myself enough and even willing to put a mobile number/email if its helps for someone to get back to me.
as stated before, this initial process setup was already done on the system created already for this so all that was needed before was to get the already formatted data and do what was needed. This is beyond me and so please looking for help or i will be forever looking at the job in the newspaper with a tear in my eye.
thanks
jazzlover
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: converting a csv file to fix width text
by runrig (Abbot) on Oct 30, 2015 at 20:22 UTC | |
|
Re: converting a csv file to fix width text
by Tux (Canon) on Oct 30, 2015 at 21:09 UTC | |
|
Re: converting a csv file to fix width text
by GotToBTru (Prior) on Oct 30, 2015 at 20:19 UTC | |
|
Re: converting a csv file to fix width text
by graff (Chancellor) on Oct 31, 2015 at 05:00 UTC | |
|
Re: converting a csv file to fix width text
by flexvault (Monsignor) on Oct 31, 2015 at 15:26 UTC | |
|
Re: converting a csv file to fix width text
by stevieb (Canon) on Oct 30, 2015 at 19:43 UTC | |
by GotToBTru (Prior) on Oct 30, 2015 at 20:23 UTC | |
|
Re: converting a csv file to fix width text
by Anonymous Monk on Oct 30, 2015 at 19:07 UTC | |
|
Re: converting a csv file to fix width text
by Anonymous Monk on Oct 30, 2015 at 19:26 UTC |