#!/usr/bin/perl -w use strict; while () { my $line = $_; $line =~ s/\s+/\|/; $line =~ s/\s+/\|/; $line =~ s/\s+/\|/; $line =~ s/\s+/\|/; $line =~ s/\s+/\|/; print $line; } __DATA__ This# is stand alone data "but this data needs to , stay together/ and here is some more -but this is a single column