Perl Script that will read an input file and create two new files based on the data from the first file

Budget $10 - $30 USD
Bids 18
Average Bid $29

Need a perl script written that will do the following:

1. Read a text file
2. Based on data in this file write to two new text files.
3. It must allow for variable file names. So I would run the script like... perl [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view]
4. No data loss from the input file... All data from the input file will go in either of the Output files or Both Files.
5. Spacing and tabs need to remain in place. No loss of formatting.
6. Basically, read a line, write the same exact line to one or both of the output files.

This log file is a trace of some directory based events. It has XML in the events and the spacing and tabs of these xml text must not change.
Each line in the input file will be one of these kinds of lines. On the lines with the TIMESTAMP, anthing after the second ":" is just data.
The TIMESTAMP can be many formats and styles. Sometimes it has a colon in it sometimes it does not.

XML Nodes or attributes.
JUST DATA and not XML nor part of the ST or PT lines

See attached files for example

Read line of input doc
Save in a variable if the line contains a "ST:" or "PT:" or ":"
If line contains a "TIMESTAMP:SomeData ST:"
Then Write line to [url removed, login to view]
If line contains an "TIMESTAMP:SomeData PT:"
Then Write line to [url removed, login to view]
If line contains just a ":" (So no ST: or PT:) or if it say "EV:"
Then Write line to both Files
If line contains XML data
Then read the variable (ST: or PT:) and write all the XML data to the appropriate output file.
(So if a line is read that contains then read the variable for PT: or ST: and write the line including formatting to the appropriate output file)
(Each subsequent xml data line must be then written to the same file until a new line is read that has a "PT:" "ST:" or just ":" in it.)
If the line is just data or is a blank line and does not have any ST: PT: single colon, or XML data
Then do same as if XML data. Read variable and write to the appropriate file.

See files attached for samples.
For someone who knows perl really well, this should be a pretty easy script.
Thanks for bidding.

Post a Project Like This

This project was awarded to


A world-class professional who recently joined Freelancer. He is amazing, with superior subject-matter expertise, astounding professionalism and execution excellence. He provides support at every stage of the project and ever willing to help. He thinks beyond the expected scope given and will add extra value, even at no extra fees. He comes 101% recommended especially for his willingness to go the extra mile. I encourage everyone seeking world-class analytics solution to engage this guy.
About the Freelancer
agaved Profile Picture

I have a PhD in Computer Sciences and Combinatorial Optimization. I moved to Brazil in 2008 to manage a joint venture between One Italia ( and Grupo Bandeirantes de Comunicação (http:/ I always enjoyed the quantitative part of my work, I am now actively studying Data Science. Here a list of the courses I took on Coursera: . I analyzed models with +500 variables, and crunched 0.5 Tbyte of data using PIG/Map Reduce on Amazon WebServices. I routinely use Perl, SQL, R, and I am learning Javascript and Python. Specialties: Statistics, Perl, R, Data analysis, Brazilian and Italian Market.

Looking to make some money?

  • Set your budget and the time frame
  • Outline your proposal
  • Get paid for your work

Bids on this Project

  • kartikprmr Profile Picture


    Ahmedabad,  India

    Very fast and efficient programmer. More than 3 years of experience in web scraping, web automation, data automation.

    PHP, Perl, Python, and Visual Basic

  • mccheung Profile Picture


    Beijing,  China

    And God said, Let there be light: and there was light!! 5+ years perl programer, Web develop and Server side tools develop.

    PHP, Perl, Javascript, and Script Install

  • idleswell Profile Picture


    Fletchers Lake,  Canada

    Hello, I am a highly experienced Linux guru and scripting expert committed to delivering superior solutions to clients. I have over 15 years experience as a Unix system administrator and 25+ years experience in Perl scripting. I have taught university software engineering courses with Perl units. Other areas of technical expertise include: C/C++ programming, Prolog and LISP programming, HTML, Javascript and PHP. Client satisfaction is my priority. In 10+ years as an independent consultant I have delivered over 500 successful contracts through various freelancing sites. I achieve high ratings through technical knowledge and extensive communication with clients. Regards, Alan Idler Chief Software Architect Idleswell Software Creations

    PHP, Perl, C Programming, and Javascript

  • sandervandijk Profile Picture


    London,  United Kingdom

    ## BIO - MSc in Artificial Intelligence - PhD student in CS/AI - >16 years programming experience - 2 years commercial development experience - Fluent in C++, Java, C#, PHP, Perl, JavaScript, etc.

    Perl, C Programming, Javascript, and XML

  • JulianRadev Profile Picture


    Triavna,  Bulgaria

    Linux, Perl, MySQL, VoIP

    Perl, Linux, Web Scraping, and Web Search

  • kethseeyalusha Profile Picture


    chennai,  India

    Perl Web Development and Scrapping

    Perl, Data Processing, Data Entry, and Facebook Marketing

  • gangabass Profile Picture


    Irkutsk,  Russian Federation

    SKILLS * Object Oriented Programming (Perl/Python/C#/VB/PHP) * Web Scraping - Scrapy, Mechanize, Selenium, Curl, Python, Java, Perl * Crawling , Data Mining, Data Extraction, Image Scraping * Automatic Form Submission I can scrap any data from any website. Captchas, Ajax, Javascript or any other technology is no problem. I'm programmer with 15+ years of experience. Most of my work is done in Perl but I know PHP, Python, C#, C++, Javascript, Visual Basic. Also I have experience working with MySQL, PostgreSQL, MS SQL and Access. I have completed several hundreds of web and desktop automation projects (data scraping and processing).

    Perl, ASP, XML, and Python

  • techvolcano Profile Picture


    Banglore,  India

    We are a team of technocrats with expertise in : - Perl - PHP - Python - SQLite - MySQL - PostgreSQL -JQuery -HTML5 -AmCharts -Highcharts -Payment Gateway Integrations

    Perl, Javascript, XML, and Python

  • puzzles Profile Picture


    Ernakulam,  India

    I'm an expert embedded programmer with hands on experience in PIC Series, Atmega Series, Arduino, Renesas microcontrollers. And familiar with IDEs like MPLAB, HEW, Arduino, AVR Studio etc. I'm also familiar with PCB designing software like EAGLE, KICAD, PROTEUS etc. Currently I help students with Academic Projects, Robotics and Embedded System Training, Academic Seminars and Workshops etc.

    Perl, C Programming, Python, and Photography

  • vw8168663vw Profile Picture


    Delhi,  India

    ## BIO Perl Programmer working for education firm ## Area of Expertise Perl,linux,Matlab,MSsharepoint,HTML5

    Perl, Javascript, XML, and Linux