Write some Software

I need a PHP function to transform some data sets.

Input data is CSV format , output is txt. I have added some data sets to play with.

This is how I would like the data transformed:

Two consecutive lines from the CSV represent the start and finish of a process.


[url removed, login to view],8337,,,181976,

[url removed, login to view],8468,,,181976,

It is a start if second value is 8337.

It is a stop if second value is 8468.

The values are suppose to be always in sequence (a line with 8337 always followed by a line with 8468), if not it means corruption of data (see below).

I need this two lines to become one(from example above):

[ 'Session: 181976', new Date(2014,09,25,16,48,43), new Date(2014,09,25,16,53,52)],

So second last value from first line becomes 'Session: value' and then some work with the data stamp.

Another example:

[url removed, login to view],8337,,,182001,

[url removed, login to view],8468,,,182001,

Result expected:

[ 'Session: 182001', new Date(2014,09,25,16,54,30), new Date(2014,09,25,16,58,13)],

Another example (now for more lines):

[url removed, login to view],8337,,,180226,

[url removed, login to view],8468,,,180226,

[url removed, login to view],8337,,,156780,

[url removed, login to view],8468,,,156780,

[ 'Session: 180226', new Date(2014,09,25,17,47,24), new Date(2014,09,25,17,56,15)],

[ 'Session: 156780', new Date(2014,09,25,17,56,51), new Date(2014,09,25,18,47,27)],

Some additional rules:

- if first line of the file starts with 8468, that line will be discarded.

- if last line of the file finishes with 8337, that line will be discarded.

- if a line with 8337, anywhere in the file, is followed by a line with 8337, the first line will be discarded from resulting data set.

Some of the lines in the file will not have a value for second to last, then it simple becomes 'Session: '.

I hope I managed to make sense, if not, ask away.

Beceriler: PHP

Daha fazlasını gör: how to make sequence, always write, data input output software, php function write, php write csv, software away, input output software, write transform file, write csv file, php expected line, format output date php, format output, csv php line line, php write, write php txt, php write txt, play sequence line, write sets, write txt php, php write file format csv, php write txt file, txt csv format, php file date stamp, software write protection, free software write book

İşveren Hakkında:
( 1 değerlendirme ) Auckland, New Zealand

Proje NO: #6508060



The PHP function I will build will receive the CSV file name and will return the text as a string, with each line terminated by a carriage return character. It can be called by an upload file handler and the result di Daha Fazla

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% NZD
(57 Değerlendirme)

Bu iş için 25 freelancer ortalamada $152 teklif veriyor


Hi, This is Gopal for STALLIONi, I am comfortable for the terms you described. Shall we discuss about the task? Please text me here when you ready to discuss about the task. Thanks

in %bids___i_period_sub_35% gün içinde147%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(247 Değerlendirme)

Hi I have gone through the details of your project and we find it well within our capabilities. I offer a wide range of services, including Web design, PHP/MySQL web application development, Open sources like Joo Daha Fazla

in %bids___i_period_sub_35% gün içinde195%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(280 Değerlendirme)

Hey there. A well detailed task I should say :) This can get me a bit busy for upcoming weekend :) Make contact here or using my contacts from [login to view URL] Cheers mate. Oh, and no payment in adva Daha Fazla

in %bids___i_period_sub_35% gün içinde200%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(10 Değerlendirme)

A proposal has not yet been provided

in %bids___i_period_sub_35% gün içinde99%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(56 Değerlendirme)

WHOA! Hey there, My name is Faisal Malik and I’m the lead developer of Hexamilesoft Company. We are the web development and social media/SEO/SMO/SEM professionals and having more than 12 year experience along with r Daha Fazla

in %bids___i_period_sub_35% gün içinde90%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(85 Değerlendirme)

Hello, I have gone through project description, but I would like to discuss to clear my understanding of requirements. Please message me so we can discuss the requirement in more details, clear doubts and move ah Daha Fazla

in %bids___i_period_sub_35% gün içinde263%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(52 Değerlendirme)

Greetings sir, i am an expert freelancer. for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert desktop software/macro/bot/ Daha Fazla

in %bids___i_period_sub_35% gün içinde150%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(83 Değerlendirme)

Hi its seems to be interesting and logical project as i have done number of complex and logical projects where the operation are performed after fetching the data from the csv so i can apply all the rules that you have Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% NZD
(85 Değerlendirme)

expertise in php/mysql,html,html-5,bootstrap,android,css,css-3,cakephp (MVC),LARAVEL 4,symfony-2,YII,have more than 11 year of experience we build more then 100 php/mysql projects worked on joomla,wordpress,magento Daha Fazla

in %bids___i_period_sub_35% gün içinde170%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(25 Değerlendirme)

Hello! It does appear to be clear enough, though just to confirm you want the dates in the array to be the javascript create a date statement for the date and not an actual date? Can work on this pretty much stra Daha Fazla

in %bids___i_period_sub_35% gün içinde40%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(47 Değerlendirme)

A proposal has not yet been provided

in %bids___i_period_sub_35% gün içinde250%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(30 Değerlendirme)

Hello sir, I am a PHP Certified Developer having an experience of more than 5 years in development platform. I am ready to start work with you now. I have read your Project Details and understood 100% that what y Daha Fazla

in %bids___i_period_sub_35% gün içinde233%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(9 Değerlendirme)

Hello, I am 4+ years of experienced developer and can do this csv reading and convert it to text file with the formatting the data into array and ready to start working on this. Thanks, Waiting for your reply.

in %bids___i_period_sub_35% gün içinde122%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(27 Değerlendirme)

hello ! , thank you for your post. I'm expert in HTML5, javascript animation, jQuery, mobile phone, PHP, SQL, flash, actionscript3.0 and have several experts of web fields. your task is not difficult for me. and also I Daha Fazla

in %bids___i_period_sub_35% gün içinde155%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(15 Değerlendirme)

This is an easy project for me. Just award me to start right now. One question: Will the last line of text file has a comma "," at the end or nothing? Thank you in advance.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% NZD
(9 Değerlendirme)

Hi Employer, ••••>> As we have gone through Requirement on your post for Developing Software. ••••>> We also seen all examples about starting Date and Ending Date. And also gone through the CSV. ••••>> We are Glad Daha Fazla

in %bids___i_period_sub_35% gün içinde147%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(3 Değerlendirme)

A proposal has not yet been provided

in %bids___i_period_sub_35% gün içinde155%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(5 Değerlendirme)

Hi, I am Thiyagarajan, web developer with strong knowledge in HTML, PHP, Jquery, CSS, Mysql. Recently worked sites. [login to view URL] [login to view URL] [login to view URL] [login to view URL] Daha Fazla

in %bids___i_period_sub_35% gün içinde222%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(1 Yorum)

Hi, Greetings of the day! I am writing in response to your job post for a “Write some Software”. After carefully reviewing the experience requirements of the job description, I feel that I am a suitable match Daha Fazla

in %bids___i_period_sub_35% gün içinde155%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(1 Yorum)

I can do this fast and cheap. All i need is a good review so be confident I'll do my best. I've already done things like this. PM me for more details. Good luck

in %bids___i_period_sub_35% gün içinde88%project_currencyDetails_sign_sub_37% %project_currencyDetails_code_sub_38%
(1 Yorum)