MS Access VBA Data import for non-std file extensions - ms-access

I am struggling to find the code I need to import a file into an access table.
It is a straight forward text file import however, the source file comes from a third party system and therefore the file extension is not the usual .txt file extension.
Instead the file is presented as ".ZZ;1"
This means that in order to import into access, I have to manually change the file extension before performing the import.
I wonder if there was a way to import the file (using VBA) with its given extension?
Or perhaps there is a piece of code which will allow me to change the file extension to something that access can read before I run my import script.
Any help or direction would be appreciated.

You can save yourself some grief by renaming the file to a standard extension (.txt or .csv) before importing it.
To rename: use the Name Statement
e.g.
strNewName = Replace(strPathFile, ".ZZ;1", ".txt")
Name strPathFile As strNewName
or if you don't want to change the original file, use the FileCopy Function, or FileSystem.CopyFile

Related

MS Access 2013 export query-to-XML not saving file

I'm trying to save several of my queries as XML files in order to re-assemble my database in another location where the only viable transfer method is text or XML files via email (long story).
When I use the built-in export function, Access allows me to select a save location and nest the schema inside of the XML file, and then says that the export was completed successfully. The file is not in the destination folder, and no error was thrown.
This only happens when exporting bound queries. Other Access elements (tables and forms, for example) export just fine.
If I watch the folder during the export process, I see a file appear very briefly, and then dissapear. Has anyone else experienced this?

I get a mysterious "Neo.ClientError.Statement.InvalidSyntax" error when loading a CSV in Neo4j

For a course on Excel I was trying to load a CSV in Neo4j (first time using this application) when I was blocked at the first step of replicating an example shown in said course: loading.
The command which was used in the example was this;
LOAD CSV WITH HEADERS FROM "file:/path/to/file/file.csv"
as row
CREATE (m:movie {name:row.movie})
But it gave syntax errors. I found out I could correct it by using double \ and add "file:";
LOAD CSV WITH HEADERS FROM "file://C:\\path\\to\\file\\file.csv"
as row
CREATE (m:movie {name:row.movie})
Neo4j accepts this syntax, processes for a few moments, and returns YET ANOTHER error;
Neo.TransientError.Statement.ExternalResourceFailure
I tried the same commands (original and my own) in the online Neo4j console but no luck. I can reach the file using that path without problem; it really is there. The CSV file consist out of just 5 strings of regular letters, that's all. No fancy formatting or characters.
What's going on?
Not that mysterious, Neo4j's IMPORT CSV function looks for the specified CSV file in the import directory within your server configuration for that database, as specified at the top of its server configuration file. (IE: dbms.directories.import=import in your neo4j.conf file.)
You should create the import directory in...
"C:\Users\[User Name]\Documents\Neo4j\default.graphdb\"
If you place your CSV file in there, you can specify any sub-directory or just the "file.csv" you want to import with the IMPORT CSV function as below.
LOAD CSV WITH HEADERS FROM "file:///file.csv"
AS row
RETURN row
LIMIT 5
Try using:
"file:///C:/path/to/file/file.csv"
Since your file is on your local computer, the third / following the file scheme is not preceded by a host name or address -- but it still needs to be there. Also, file URI path separators should be forward slashes (even on Windows machines).
See the File URI scheme Wikipedia page if you need more information.

Creating a CSV file with the Report Generation Toolkit in Labview

I want to create .csv files with the Report Generation Toolkit in Labview.
They must actually be .csv files which can be opened with Notepad or something similar.
Creating a .csv is not that hard, it's just a matter of adding the extension to the file name that's going to be created.
If I create a .csv file this way it opens nicely in excel just the way it should, but if I open it in Notepad it shows all kind of characters and it doesn't even come close to the data I wrote to the file.
I create the files with the Labview code below:
Link to image (can't post image yet because I've got to few points)
I know .csv files can be created with the Write to Spreadsheet VI but I would like to use the Report Generation Toolkit because it's pretty easy to add columns and rows to the file and that is something I really need.
you can use the Robust CSV package on the lavag.org forum to read and write 2D arrays to CSV files.
http://lavag.org/files/file/239-robust-csv/
Calling a file "csv" does not make it a CSV file. I never used the toolkit to generate an Excel file, but I'm assuming it creates an XLS or XLSX file, regardless of what extension you give it, which is why you're seeing gibberish (probably XLS, since it's been around for a while and I believe XLSX is XML, not binary).
I'm not sure what your problem is with the write spreadsheet VI. It has an append input, so I assume you can use that to at least add rows directly to a file, although I can't say I ever tried it. I would prefer handling all the data in memory explicitly, where you can easily use the array functions to add rows or columns to the array and then overwrite the entire file.

Issues with Access parsing double quotes in a CSV file

I have a large CSV file that I am trying to import into Microsoft Access but I am running into issues. Assume pipes represent different cells in the database
Assume my content is the below. The second entry will only parse the word my with default settings and will not import the word content into the database even though the import wizard implies that it will. The default settings being , delimiter and " text qualifier.
|my content is good|
|my|
Now if i change the text qualifier to NONE it parses the entire second entry and my content will be imported into the database however the first entry will wind up being in 3 different cells in the data base and will show up as
my|content|is|good.
|my content
I used pipes to imply different cells.
This seems like a limitation in Microsoft Access. Is anyone familiar with a workaround for this?
Original content:
,"my,content,is,good","",
,my"content","",
I am using the import wizard
Yes, this is a limitation of the CSV import capabilities in Access. For whatever reason, Access has always been more restrictive than Excel in its abilities to parse CSV files.
So, one workaround would be to open the CSV file in Excel, save the file as an actual Excel sheet, and then import the Excel sheet into Access. For example, the CSV file
this,is,a "test",CSV file,"Ugly, yes, but still parsable."
is "non-standard" (if one is willing to concede that there is such a thing as a CSV "standard"), and Access cannot import it directly. (It either complains of an "Unparsable Record" or it splits the last field on the commas, depending on the "Text Qualifier" setting.)
However, we can open it in Excel
save the file as "foo.xlsx", and then import the .xlsx file into Access

BMC Remedy user 7.5 Could i make a macro that can read a .csv file?

I need to create a macro in BMC remedy user 7.5, that can read a csv file and update all items contain in the csv file?
Is it possible ?
I have to make a large bundle of item and edit there location.
Thank you
You can't create a macro. But you can use the Remedy Import Tool. It has the capability to automatically import a CSV file. It takes as inputs a mapping file and the CSV file (with full paths of course).
Check out the guide titled "BMC Remedy Action Request System 7.6.04 Configuration Guide". You should find what you're looking for there.
Best of luck,
Mike