Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Little reformatting script I came up with the other day
Message
General information
Forum:
Perl
Category:
Syntax & Programming
Title:
Little reformatting script I came up with the other day
Miscellaneous
Thread ID:
01150191
Message ID:
01150191
Views:
57
When was the last post in this forum, anyhow?

I needed to turn:

Name
Address
City St Zip

Name
Address
City St Zip

into:

Name, Address, City St Zip
Name, Address, City St Zip

but of course, they weren't that standardized. With a little help from the folks on perl.beginners, I came up with the following:

local $/ = "\n\n";
open(ADDRESSES, "c:\\temp\\testing.txt") or die "Could not open input
file: $!";
open(OUTCSV, "> c:\\temp\\test2.txt") or die "Could not open output
file: $!";

while() {
$NextRec = "\"".join("\",\"", split("\n"))."\"\n";
print OUTCSV $NextRec;

}

I wonder what I'll find to do next. :-)
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Reply
Map
View

Click here to load this message in the networking platform