Have CSV file, need to auto add line breaks
Thu, 03/06/2008 - 8:12pm
15 years
|
I have several very large CSV files that I'd like to use in a garmin gps, as POIs. The problem is the comment feidls are too long & I need to add line breaks. Does anyone have a macro for excel or open office that will automatically do that for me? I'm not smart enought to figure it all out.
I'd like ot be able to customize how many charachters are left between line breaks.
thanks
http://www.poi-factory.com/garmin-csv-file-format
You can add line breaks if you edit the file in a plain text editor rather then Excel by enclosing the field in quotes and then putting the line breaks in.
See this link for more details and specifically the section about Multi-line comments...
http://www.poi-factory.com/garmin-csv-file-format
PT
Garmin nüvi 200 (my first GPS), 780, & 3700 Series. And a Mac user.
I understand how to manually
I understand how to manually add line breaks. My problem is I have some files with ~10,000 POIs and I would like to know how to have excel, or some other program, add the line breaks for me. I am a bit lazy.
thanks
Excel
I can help with Excel, but it would be helpful to know your criteria for adding line breaks? For example, do you want to replace every comma with a line break?
Tom
This might work
I understand how to manually add line breaks. My problem is I have some files with ~10,000 POIs and I would like to know how to have excel, or some other program, add the line breaks for me. I am a bit lazy.
thanks
I'm a computer programmer and just so happened to be working on a program that deals with parsing CSV files. I threw something together to do this. You can download it here:
http://members.cox.net/sbaudoin/CSVTest.exe
This will only work if you have 4 fields and the 4th is the comment. Basically just key in the max characters for the comment, click browse, select your file, and it will create a file called NewFile.csv in the same folder. Also, it will not break in the middle of words unless it's longer than the limit, so that way you won't have words cut off.
Let me know if this works for you. If it does something weird in some cases, let me know and I'll see if I can fix it.
Steven - StreetPilot c340 & nuvi 765t
I think your program is
I think your program is pretty close to what I'm looking for.
Basically, some of my comments are very long right now. I want something that will go through them, and automatically add line breaks after every X# (user configurable) characters, and add a new line break.
So, if my comment was 75 charachters long, the program/Macro would add in 3 line breaks, after every 21 charachters, making the comment 4 lines long. It would also do this automatically for all comments in a large CSV poi file.
thanks
Did you try it out?
I think your program is pretty close to what I'm looking for.
Basically, some of my comments are very long right now. I want something that will go through them, and automatically add line breaks after every X# (user configurable) characters, and add a new line break.
So, if my comment was 75 charachters long, the program/Macro would add in 3 line breaks, after every 21 charachters, making the comment 4 lines long. It would also do this automatically for all comments in a large CSV poi file.
thanks
Did you try my program out? It sounds like that's what I made it do, plus it puts the multi-line comments in the format that POI Loader needs, with quotes around it. The only thing that sounds like it might be different is that I don't exactly break at every X characters if it would split a word. If you want it to be exactly X characters and split words, let me know.
Steven - StreetPilot c340 & nuvi 765t
What about us poor Mac users?
I'm a computer programmer and just so happened to be working on a program that deals with parsing CSV files. I threw something together to do this. You can download it here:
http://members.cox.net/sbaudoin/CSVTest.exe
What? No Mac version??!!!???
Bigot!
PT
Garmin nüvi 200 (my first GPS), 780, & 3700 Series. And a Mac user.
Sorry, I guess I picked a
Sorry, I guess I picked a bad file to test with. Your program is exactly what I need!!! Thanks a lot.
By X characthers, I was wanting to configure the line breaks, just what your program does, when its asks for the Max comment length.
Are you working on any newer, improved versions?
thanks
HAHA
I'm a computer programmer and just so happened to be working on a program that deals with parsing CSV files. I threw something together to do this. You can download it here:
http://members.cox.net/sbaudoin/CSVTest.exe
What? No Mac version??!!!???
Bigot!
PT
If you have a way to run .Net programs on Mac, then maybe I'm not a Bigot
Steven - StreetPilot c340 & nuvi 765t
problem with your program
I just found a problem with your CSV test program. It is putting Quotes "" around the coordinates in the CSV file, so Garmin's POI loader will not recognise the file. If you could fix this, I'd appreciate it.
thanks
Glad I could help
Sorry, I guess I picked a bad file to test with. Your program is exactly what I need!!! Thanks a lot.
By X characters, I was wanting to configure the line breaks, just what your program does, when its asks for the Max comment length.
Are you working on any newer, improved versions?
thanks
I wasn't planning on adding anything to it. I was working on a project that dealt with CSV parsing and saw you post this so I thought I'd whip something up to help out.

Glad this turned out to be useful
I can imagine you didn't want to edit 10,000 entries by hand
Steven - StreetPilot c340 & nuvi 765t
Interesting...
I just found a problem with your CSV test program. It is putting Quotes "" around the coordinates in the CSV file, so Garmin's POI loader will not recognise the file. If you could fix this, I'd appreciate it.
thanks
Ok...I'll see about not adding any quotes. I thought POI Loader could handle that. I'll let you know when it's done.
Steven - StreetPilot c340 & nuvi 765t
POI loader can handle quote
POI loader can handle quote around the name and the comments (required for line breaks), but it can not handle them arround the coordinates.
thanks
Ok...fixed the quotes issue.
Ok...fixed the quotes issue. Here's the link again:
http://members.cox.net/sbaudoin/CSVTest.exe
Steven - StreetPilot c340 & nuvi 765t