CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...: Re: [2teez] Pattern search in txt file and output them with comma seperated value : Edit Log



Zhris
Enthusiast

Sep 28, 2013, 7:12 PM


Views: 11010
Re: [2teez] Pattern search in txt file and output them with comma seperated value

Hi 2teez,

I like your solution, your Perl has improved a lot in a short time!

In order to get your code to work I also had to strip off the whitespace at the end of each line ( s/\s*$//; ). Was this not an issue for you when testing.

I opted for the compact / regexp approach, just to be less strict with regards to the input data format, in case the OP's real world data required considerable trimming / casing.

The OP actually contacted me with regards to this, and presented a more comprehensive input data example, which neither of our scripts covers. Certain key / value groups exist on the same line and some additional formatting was required. It also wasn't suitable to group values in a list ( there wasn't enough information provided to know how to handle this potential situation ) since "repeats" needed to be handled in a completely separate record, if that makes sense Crazy.

Chris


(This post was edited by Zhris on Sep 28, 2013, 7:18 PM)


Edit Log:
Post edited by Zhris (Enthusiast) on Sep 28, 2013, 7:14 PM
Post edited by Zhris (Enthusiast) on Sep 28, 2013, 7:15 PM
Post edited by Zhris (Enthusiast) on Sep 28, 2013, 7:16 PM
Post edited by Zhris (Enthusiast) on Sep 28, 2013, 7:16 PM
Post edited by Zhris (Enthusiast) on Sep 28, 2013, 7:17 PM
Post edited by Zhris (Enthusiast) on Sep 28, 2013, 7:18 PM
Post edited by Zhris (Enthusiast) on Sep 28, 2013, 7:18 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives