To MM0MFM, database problem

Hello Andy

When I download from the database the CSV file containing all summits, each field uses a comma (,) separator.
But, sometimes, there are also commas in the field “SummitName” such as for EA2/HU-089 = “San Martín, Peña de” and many others

It is a problem when we are trying to recover each field in a record.
But I don’t know how we could avoid the problem, unless to use another separator such as a semi colon (;).
And this may change lot of soft in the database…:wink:

Another solution is to ask to avoid commas in the field SummitName

73 Alain F6ENO

In reply to F6ENO:
export the Name field as “” text delimited when downloading?
It’s ok from the csv point of view …
73 de mikel

In reply to F6ENO:

I was fairly sure the export of summits and individual log files wrapped any value containing a comma with quotes.

i.e. San Martín, Peña de is written as “San Martín, Peña de” to the file. In which case the comma should not be a problem.

I’ve checked and the summitslist.csv loads into Excel 2010 with no problems.

If I view the raw CSV data then I can see

EA2/HU-088,Spain (North),Huesca,Santa Marina,1799,5902…
EA2/HU-089,Spain (North),Huesca,“San Martín, Peña de”,1792,5879…
EA2/HU-090,Spain (North),Huesca,Amariedo,1791,5876

so the quoting code is wrapping the names.

It would be much, much better if the names didn’t have embedded commas and we check for that now. Some have still crept in.

I can remember having to modify some code I wrote that processes CSV files to parse the line for embedded commas and changed non-wrapped commas to another character. Messy but not tricky to write.

Andy
MM0FMF

In reply to F6ENO:

Hello Alain - in some languages (or special routines) for a “explode”-commmand, “exploding” a csv record, you can define a “delimter”. I am sure your will find a solution for that problem in every programming language via google.

73 qro,

Mario

In reply to DL4MFM:
Hello all

Thanks for your replies
I found another solution without using an “explode” command.
I look for commas in the csv line and search for a comma followed by a number (the first digit of the altitude of the summit).
Now it works, thanks again !

Alain F6ENO