Split a long field over multiple lines : Field « Report « Perl






Split a long field over multiple lines

   

    #!/usr/local/bin/perl -w

    while (<ARGV>)
    {
        chomp;
        ($number,$type,$name,$price,$desc) = split (/\|/);
        write;
    }

    format STDOUT =
    @>>>> @|||||| @<<<<<<<<< @<<<<<<<<<<<<< $@####.##
    ^<<<<<<<<<<<<<<<<<<<<<<<<<
    $,,$number,$type,$name,$price,$desc
    ~                                            ^<<<<<<<<<<<<<<<<<<<<<<<<<
    $desc
    ~                                            ^<<<<<<<<<<<<<<<<<<<<<<<<<
    $desc
    .

   
    
    
  








Related examples in the same category

1.Format Field Types
2.Multiline fields
3.Field Designator Symbols
4.Field Display Symbols
5.Different types of fields
6.Writes a string using the multiline field format.
7.Using value fields to print output.
8.Valid value-field formats.
9.Limitations of the @* value field.
10.A program that uses a value field that does formatting.