Hello. ive had a job interview for a data processing department and they have said that they only use access or excel. They do not at all have a programming department and would like me to start one up if im succesful. I got laid of me job doing perl and that was 5 years ago so very rusty. I have old programmes laying about but that was with data already changed from csv to fixed with text from programs that was already set up so i never needed to worry about this part. Please can you help me with this issue because its a step into something i really want to be a part of.

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


In reply to converting a csv file to fix width text by jazzlover

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.