yulqen / datamaps

MOVED: Command line interface to yulqen/bcompiler-engine. Used by DfT to collect and clean data using Excel spreadsheets.
https://git.sr.ht/~yulqen/datamaps
MIT License
2 stars 2 forks source link

export master command -d flag file path error #19

Closed banillie closed 3 years ago

banillie commented 3 years ago

When doing the command datamaps export master [PATH to master] -d [PATH to datamap.csv] get the error:

CRITICAL - Cannot find C:\Users\Standalone\Documents\datamaps\input\Documents\datamaps\Q3_dm_export.csv

I've kept the actual file path in there so you can see that the file path is being repeated. i.e. has Documents twice. You only need a dummy master and datamap to check this.

yulqen commented 3 years ago

If you put the datamap in another location (Desktop?) and call again, do you get a similar error?

banillie commented 3 years ago

Yes. CRITICAL - Cannot find C:\Users\Standalone\Documents\datamaps\input\Desktop\datamap_export.csv

yulqen commented 3 years ago

Can you please email (personal email) me a copy of the current blank_template.xlsm file so I can test with most up to date files? I've probably got one around somewhere on another machine but if you an ping it in an email, that would be great. Ta.

banillie commented 3 years ago

Done and done.

yulqen commented 3 years ago

Unable to reproduce.

What is the exact command, Will - particularly what does the path to the datamap file look like in the -d flag? I've tried both relative and absolute path with no problems. Not tested on Windows.

banillie commented 3 years ago

Yes this error was on Windows. However, given you couldn't reproduce did some further testing and got it to work with absolute rather than relative file paths. so

datamaps export master C:\Users\Standalone\Documents\datamaps\output\master.xlsx -d C:\Users\Standalone\Documents\datamaps\datamap_export.csv

works. But

datamaps export master Documents\datamaps\output\master.xlsx -d Documents\datamaps\datamap_export.csv

gets the error as above.

yulqen commented 3 years ago

The second example you give (the relative path) wouldn't work unless your working directory is C:\Users\Standalone. You could use echo %cd% in the command prompt to check that. Assuming that is the case, I'm not sure what's going on here and would have to do some testing in Windows. But advice for now is use the absolute path.

Don't forget your can write your commands into bash scripts if you're doing them a lot! You don't have to keep typing 'em out...

On 29-04-2021, Will Grant wrote:

Yes this error was on Windows. However, given you couldn't reproduce did some further testing and got it to work with absolute rather than relative file paths. so datamaps export master C:\Users\Standalone\Documents\datamaps\output\master.xlsx -d C:\Users\Standalone\Documents\datamaps\datamap_export.csv works, but datamaps export master Documents\datamaps\output\master.xlsx -d Documents\datamaps\datamap_export.csv gets the error as above.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/yulqen/datamaps/issues/19#issuecomment-829062680

--

Matthew Lemon Email: @.***

banillie commented 3 years ago

Yeap working directory is C:\User\Standalone so weird.

yulqen commented 3 years ago

Use absolute paths for now to be safe; leave the issue open, I'll look into this.