Trouble parsing a CSV file

Hi all, I’m trying to automate some things and I’d like to try sending Catalogue name, RA and Dec to a Voyager dragscript. I can organise most of that, but I just can’t parse the CSV file in a Windows batch file. The problem is a result of consecutive commas and commas inside fields which are wrapped in quotes. The CSV file itself seems to be perfectly well-behaved and unambiguous, but I just can’t parse it in a batch file.

Has anyone tried to do this, in which case I’d love to see your batch code (not powershell or python)?

Alternatively, is there a way of customising the CSV exporter to only have Catalogue name, RA and Dec?

Thanks!

Just to discard a local issue, could you please try opening the CSV file on Excel or any spreadsheet app to see if it loads correctly? If so, then there’s probably not a problem with the CSV file but the parsing.

I like the idea of being able to customize the downloaded CSV, I’m adding it to the backlog. Hopefully I should be able to do it in the coming weeks.

Yes, it opens fine in Excel. It’s a well-behaved CSV, and any comma that’s net meant to be a delimiter is enclosed in double quotes.

Cheers, Bill

1 Like