#!/usr/bin/perl use strict; use warnings; while (){ chomp; next if (/Order/); print (" string $_ \n"); $_ =~ s/\"//g; my @array = split /|/ ; print(" order $array[0] \n"); } __DATA__ "129822"|"Custom Currency"|"Living the Dream"|"400" "129823"|"Custom Currency"|"Living the Dream"|"500" "129824"|"Custom Currency"|"Living the Dream"|"600" "129825"|"Custom Currency"|"Living the Dream"|"700" "129826"|"Custom Currency"|"Living the Dream"|"800"