473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Processing CSV Files...

Hi,

As strange as it sounds, i need to convert a csv file from one csv layout to
another!...

Basically both have fields as the first line (terminated with a lfcr) but
after that the source file is pretty much continuous with a few lfcr's
through the file..

The output csv i require needs to have a "EOLEOL" at the end of each line
entry...

can anyone help me with the source code for this.. im using the free vb
express 2005.

Thanks
Jul 13 '07 #1
2 1597
"Ian Craig Armitage" <cr***@icarmitage.co.ukwrote in
news:ul**************@TK2MSFTNGP04.phx.gbl:
Hi,

As strange as it sounds, i need to convert a csv file from one csv
layout to another!...

Basically both have fields as the first line (terminated with a lfcr)
but after that the source file is pretty much continuous with a few
lfcr's through the file..

The output csv i require needs to have a "EOLEOL" at the end of each
line entry...

There is a project called "FileHelpers" on SourceForge which handles CSV
files. The project was a little buggy, but it has some nice helper
functions for CSV.
Jul 13 '07 #2
If the only thing changing is the end of line marker, do the following:

dim fIn as new IO.StreamReader("source.csv")
dim fOut as new IO.StreamWriter("target.csv", False,
System.Text.Encoding.ASCII)

do while not fIn.EndOfStream()
fOut.Write(fIn.ReadLine() & "EOLEOL") ' Note that the write is not a
writeline - you are specifying the end of line marker.
loop
fIn.Close()
fOut.Close()

Mike.
"Ian Craig Armitage" <cr***@icarmitage.co.ukwrote in message
news:ul**************@TK2MSFTNGP04.phx.gbl...
Hi,

As strange as it sounds, i need to convert a csv file from one csv layout
to
another!...

Basically both have fields as the first line (terminated with a lfcr) but
after that the source file is pretty much continuous with a few lfcr's
through the file..

The output csv i require needs to have a "EOLEOL" at the end of each line
entry...

can anyone help me with the source code for this.. im using the free vb
express 2005.

Thanks


Jul 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hayko Riemenschneider | last post by:
Hi! I've got me an XSL tranformation stylesheet for my XML file. In the XSL file I now wish to use PHP to do some scripting. So I thought I'll use the PIs like this: ...
6
by: Anders Søndergaard | last post by:
Hi, I'm trying to process a large filesystem (+20 million files) and keep the directories along with summarized information about the files (sizes, modification times, newest file and the like)...
1
by: Chery | last post by:
I used dataset to merge 2 XML files having the same structure. I managed to merge these 2 XML files but how can I write a processing instruction to link the merged file to the existing XSL...
6
by: soren juhu | last post by:
Hi, I am developing a C Program for reading over a million files of size 1 kilobytes each and sending the contents to another program using some middle ware. I need some help on designing the...
0
by: Ganapathy | last post by:
I have COM dll code written in VC 6.0. When i tried compiling this code in VC 7, The MIDL cmpiler gets called twice. i.e. it initially compiles fully & immediately a line - 64 bit processing'...
5
by: Joe Reazor | last post by:
I've got an asp.net page that has approximately 1,440 controls on it. You must think I'm crazy, but we need to have the page organized in this fashion. As you can imagine, the page takes a very...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
5
by: dmoran21 | last post by:
I am working with some files that I need to do some processing with. Essentially, these files contain rainfall reports from various automated rain gauges. These reports are given in 15 minute...
4
by: ferrad | last post by:
I have not used Python before, but believe it may be what I need. I have large text files containing text, numbers, and junk. I want to delete large chunks process other bits, etc, much like I'd...
1
by: Xah Lee | last post by:
Text Processing with Emacs Lisp Xah Lee, 2007-10-29 This page gives a outline of how to use emacs lisp to do text processing, using a specific real-world problem as example. If you don't know...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.