In Progress

File Manipulation

Program needs to run on Windows 7 Pro: Perl/Cygin/shell/C++ are all fine. Although prefer something readable for easy changes.

I have a remote server constantly streaming CSV data to a port. Something that a netcat can print. I used "nc [url removed, login to view] 5200 > [url removed, login to view] to get the data" High level, it has a 20-30 line header (which can be discarded see my attached file), and then constantly streams readings.

Date Time, Roughness

2013-05-24 20:47:30,[url removed, login to view]

2013-05-24 20:47:30,[url removed, login to view]

2013-05-24 20:47:30,[url removed, login to view]

2013-05-24 20:47:30,[url removed, login to view]

2013-05-24 20:47:31,[url removed, login to view]

2013-05-24 20:47:31,[url removed, login to view]

2013-05-24 20:47:31,[url removed, login to view]

2013-05-24 20:47:31,[url removed, login to view]

2013-05-24 20:47:40,[url removed, login to view]

2013-05-24 20:47:40,[url removed, login to view]

2013-05-24 20:47:40,[url removed, login to view]

2013-05-24 20:47:40,[url removed, login to view]

2013-05-24 20:47:40,[url removed, login to view]

2013-05-24 20:47:40,[url removed, login to view]

2013-05-24 20:47:43,[url removed, login to view]

2013-05-24 20:47:43,[url removed, login to view]

2013-05-24 20:47:43,[url removed, login to view]

2013-05-24 20:47:43,[url removed, login to view]

2013-05-24 20:47:43,[url removed, login to view]

2013-05-24 20:47:43,[url removed, login to view]

2013-05-24 20:47:43,[url removed, login to view]

There will be about 8 readings/lines in about a second. Sometimes as few as 4. sometimes as many as 10. But normally around 8 readings per part. Then a pause of about 2 seconds The normally 8 readings in about a second/part , then a pause of seconds, etc.

Things I need:

1) Don't need any information from the header, it can be skipped

2) A new file for each part. Start a new file whenever:

a) 2 seconds pass without a new reading

b) a [url removed, login to view] record is received (don't want the [url removed, login to view] in a file)

c) 10 readings are received

3) File name should be "Production YYYY-MM-DD [url removed, login to view]" Basically, the filename should be "Production + the date" making sure it's unique

4) If under 4 readings, skip the file

5) Output format is a | delimited file named "Product 2013-05-24 2013-05-24 20:47:31" using the date format above. Contents are:

START|Production|Production

DATA|Surf_Fin_Meas_1|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_2|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_3|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_4|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_5|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_6|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_7|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_8|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_MAX|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_MIN|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_AVG|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

DATA|Surf_Fin_Meas_RANGE|[url removed, login to view]|[url removed, login to view]|0|[url removed, login to view]|2|3|Surface_Finish

END|[url removed, login to view]

Notes:

1) Line (Start) 1 is static (use as is)

2) Line 2-9(13) the readings from the input file.

a) Field 1 is the word DATA

b) Field 2 is the field name (Surf_Fin_Meas(1--10)

c) Field 3 is the ROUGHNESS measurement from the input file

d) The remaining fields are static

3) The next 4 lines are MAX, MIN, AVG, and RANGE of the roughness

4) The last line is END with the DATE in windows format. The date should be last date of the readings in the input file.

Windows format is:

Integer = Int((Year - 1901) * [url removed, login to view]) + 366 + DayOfYear

Fraction = (Seconds + (60 * Minutes) + (3600 * Hours)) / 86400

Date = Integer + Fraction

Where DayOfYear for Jan 1 is 1 and Hours for 12:34 AM is 0

e.g. 01-25-1995|14:15:07

Integer = (1995-1901) * [url removed, login to view] + 366 + 25

Integer = [url removed, login to view] + 366 + 25

Integer = 34724

Fraction = (7 + (60 * 15) + (3600 * 14))/86400

Fraction = (907 + 50400)/86400

Fraction = [url removed, login to view]

Date = 34724 + .59383

Date = [url removed, login to view]

=======================

I'll have a number of upcoming projects. I've paid up to $3000 for a project in the past.

Skills: Anything Goes, C Programming, Data Processing, Perl, Shell Script

See more: nc time, nc programming, min range, high level programming, get paid input data, 123 print, shell pro, netcat, number manipulation, reading header file, windows shell program, windows min max, pause 3000, csv file input, csv data manipulation, paid streaming, print file contents, line 334, csv manipulation, file manipulation program, unique name file, perl file format, end streaming server, file notes, part time shell

About the Employer:
( 32 reviews ) Cincinnati, United States

Project ID: #4553884

Awarded to:

amsak

Placing bid

$3 USD / hour
(5 Reviews)
3.0

21 freelancers are bidding on average $7/hour for this job

idleswell

Hello, I am a Perl scripting expert prepared to create a script for this task. I will open a PMB to discuss details. A IDLER

$31 USD / hour
(146 Reviews)
5.7
s17

My bid is out of the proposed range, but I do good work and I ask a fair rate. I prefer to write this in Perl with standard modules.

$22 USD / hour
(114 Reviews)
5.6
SaSTechnologies

Please look into PM for more details. I have already designed and developed many projects regarding FILE HANDLING. Thanks Sumit SaS Technologies

$5 USD / hour
(8 Reviews)
4.7
mz1

I am expert in flat files.

$3 USD / hour
(8 Reviews)
4.2
codeguild

I can do this.

$16 USD / hour
(6 Reviews)
3.8
vkoder

let me try

$5 USD / hour
(5 Reviews)
2.7
bigdragonfly

I am interested in the project, please tell more detail of the project.

$11 USD / hour
(2 Reviews)
2.5
rimcx

Hello, I can provide a solution in C++. More details in PM.

$4 USD / hour
(1 Review)
1.3
friendlytec

Hi, we've skillful engineers with extensive C/C++ programming experience. We would like to offer our services. This task will considered as a step towards a good professional relation. Looking forward for a good busine More

$6 USD / hour
(0 Reviews)
1.0
vilvw

Hello! The task is good described and seems to be implemented for 5 days (about 15-20 hours)

$5 USD / hour
(0 Reviews)
0.0
name63

If you need an easy way to read an make some changes in code later then I can suggest perl, python or PowerShell which is built in any windows since Windows XP sp3. I'll make a well documented script which will work wi More

$5 USD / hour
(0 Reviews)
0.0
kalvyn

Hi! I am C/C++ expert. This is nice simple project with data processing. I can create program for you with described functionality in C++. Compilation, testing & completion is included.

$3 USD / hour
(0 Reviews)
0.0
adammuncey

Please see my PM for details. Thanks.

$5 USD / hour
(0 Reviews)
0.0
ankit0803

Small but interesting task to work on.

$6 USD / hour
(0 Reviews)
0.0
mwschultz

Hello! I have a Master's Degree in Computer Science, as well as over four years of professional programming experience. I believe that Perl or Python would be the best language to use for this project, and I am an expe More

$5 USD / hour
(0 Reviews)
0.0
jr593

Hello sir, can do this easily. Have lots of data collection experience, please check PMB

$4 USD / hour
(0 Reviews)
4.2
priyago

Hiello Sir, I have worked on reading CSV (and XML) files, segregating data and saving file with name in date format. Pls see my message. I would be happy to work with you and would like to hear from you.

$5 USD / hour
(0 Reviews)
0.0
mcontagious

The best way is to write it in perl, I have 6+yrs of experiance in perl. Wrote so many log parsing scripts. Please check your PMB.

$4 USD / hour
(0 Reviews)
0.0
Netkunte

Hi, I am interested in this project. Regards, Netkunte

$3 USD / hour
(0 Reviews)
3.7
tonyjacobk

I am an expert in shell programming and will be able to do this.

$3 USD / hour
(0 Reviews)
0.0