PC Review


Reply
Thread Tools Rate Thread

Changing format of a CSV file

 
 
=?Utf-8?B?RG91ZyBTdGV3YXJ0?=
Guest
Posts: n/a
 
      1st Dec 2005
My apologies in advance, as this probably isn’t a FrontPage question.
However, it is for my FrontPage site and I don’t know where else to go. If
anyone can suggest a more appropriate forum, I would be happy to post there
instead.

Anyway, here is my question. I need to convert the format of a file. The
file has a number of records, each record having a number of fields. The
fields are separated by semicolons (I believe this is known as a CSV format).
Every record has the same format and the same number of fields. What I need
to do is copy the information from this file to a second file, but changing
the sequence and content of the fields. For example, I would need to do
something like the following:

If field 4 = “H”, set field to "House"; If field 4 = “A”, set field to
“Apartment”

Copy field 5 from first file into field 7 of second file

I need to do this for a large number of files each week. Consequently, I
need a simple bit of SW (either on my computer or on my server) to do this. I
know how to do it manually, but this is far too time-consuming and error
prone.

Can anyone give me some guidance on how to do this (and what would be a
suitable language)? If I had a few lines of code in an appropriate language,
I could likely write the entire program with a bit of help. I would be
willing to pay for the help.

The files in question can be treated as text files.

Doug Stewart ((E-Mail Removed))

 
Reply With Quote
 
 
 
 
Stefan B Rusynko
Guest
Posts: n/a
 
      1st Dec 2005
You will need to hand write server side code
(depends on what your server supports)
- If it supports ASP, then you can use FileSystemObject and text streams
(see http://www.w3schools.com/asp/default.asp)

But in the long term you would be better off converting the CSV text files to a DB
(Access will import CSV files)
- where the manipulation would be easier (or perhaps not even needed)

PS
A CSV using ; as delimiter is dangerous if any of your data will also ever have ; in it
--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
To find the best Newsgroup for FrontPage support see:
http://www.frontpagemvps.com/FrontPa...3/Default.aspx
_____________________________________________


"Doug Stewart" <(E-Mail Removed)> wrote in message news:95B69E19-4946-4C45-B7AB-(E-Mail Removed)...
| My apologies in advance, as this probably isn’t a FrontPage question.
| However, it is for my FrontPage site and I don’t know where else to go. If
| anyone can suggest a more appropriate forum, I would be happy to post there
| instead.
|
| Anyway, here is my question. I need to convert the format of a file. The
| file has a number of records, each record having a number of fields. The
| fields are separated by semicolons (I believe this is known as a CSV format).
| Every record has the same format and the same number of fields. What I need
| to do is copy the information from this file to a second file, but changing
| the sequence and content of the fields. For example, I would need to do
| something like the following:
|
| If field 4 = “H”, set field to "House"; If field 4 = “A”, set field to
| “Apartment”
|
| Copy field 5 from first file into field 7 of second file
|
| I need to do this for a large number of files each week. Consequently, I
| need a simple bit of SW (either on my computer or on my server) to do this. I
| know how to do it manually, but this is far too time-consuming and error
| prone.
|
| Can anyone give me some guidance on how to do this (and what would be a
| suitable language)? If I had a few lines of code in an appropriate language,
| I could likely write the entire program with a bit of help. I would be
| willing to pay for the help.
|
| The files in question can be treated as text files.
|
| Doug Stewart ((E-Mail Removed))
|


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing file format =?Utf-8?B?TGFycw==?= Windows XP Help 3 24th Feb 2006 04:56 PM
changing th file format =?Utf-8?B?ZHJhZ29u?= Windows XP MovieMaker 3 12th Oct 2005 12:53 AM
changing file format Kristin Microsoft Excel Misc 2 20th Feb 2004 02:12 AM
Re: changing file format Bob Windows XP MovieMaker 0 28th Jan 2004 04:33 AM
changing file format =?Utf-8?B?RGF5amFjazExOQ==?= Windows XP MovieMaker 0 27th Jan 2004 08:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:33 PM.