Devam Ediyor

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.

Example:

[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ün: 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

Seçilen:

costeldumitru

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 fazlası

1 gün içinde 56$ NZD
(57 Değerlendirme)
5.5

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

graphicaa

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 3 gün içinde147$ NZD
(247 Değerlendirme)
7.7
gopalvora

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 fazlası

in 9 gün içinde195$ NZD
(280 Değerlendirme)
7.5
IevgenBaziak

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 [url removed, login to view] Cheers mate. Oh, and no payment in adva Daha fazlası

in 3 gün içinde200$ NZD
(10 Değerlendirme)
7.0
jatindhoot

A proposal has not yet been provided

in 3 gün içinde99$ NZD
(56 Değerlendirme)
6.8
hexamilesoft

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 fazlası

in 3 gün içinde90$ NZD
(85 Değerlendirme)
6.3
Champian

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 fazlası

in 4 gün içinde263$ NZD
(52 Değerlendirme)
6.1
ineedWorkJob

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 fazlası

in 3 gün içinde150$ NZD
(83 Değerlendirme)
6.1
Jeet81

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 fazlası

1 gün içinde 95$ NZD
(85 Değerlendirme)
6.1
bistanil98

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 fazlası

in 6 gün içinde170$ NZD
(25 Değerlendirme)
6.7
justTry

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 fazlası

in 0 gün içinde40$ NZD
(47 Değerlendirme)
5.0
Blackhatwarrior

A proposal has not yet been provided

in 5 gün içinde250$ NZD
(30 Değerlendirme)
5.0
MrPathu

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 fazlası

in 3 gün içinde233$ NZD
(9 Değerlendirme)
4.4
vipulparsana

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 3 gün içinde122$ NZD
(27 Değerlendirme)
4.3
cliscwang

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 fazlası

in 3 gün içinde155$ NZD
(15 Değerlendirme)
4.2
dimkazakos

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 150$ NZD
(9 Değerlendirme)
3.5
VersatileTehcno

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 fazlası

in 7 gün içinde147$ NZD
(3 Değerlendirme)
3.1
ranveersarya

A proposal has not yet been provided

in 3 gün içinde155$ NZD
(5 Değerlendirme)
2.5
thiyagp

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

in 3 gün içinde222$ NZD
(1 Değerlendirme)
2.0
abhilashtech

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 fazlası

in 3 gün içinde155$ NZD
(1 Değerlendirme)
1.9
DreadMoore

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 2 gün içinde88$ NZD
(1 Değerlendirme)
1.4