Re: [sqlite] sqlite importing csv
many thanks again for the replies and sorry I was amiss in not stating that it was sqlite3 DXCC.db, I was using the .db suffix but to no avail, however the problem has been that I was not getting it into the right folder to enter the import command. Thanks Bill you hit it on the nose, when bringing up the cmd screen it registered it was sitting at Users\John By entering cd C:\jt65Logger that put it into the correct folder and I was able to successfully import the test csv file, very simple but sadly overlooked by my ignorance. Alan ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
Various notes -At the prompt, running "sqlite3 DXCC" is starting the sqlite3 program, and telling it to open the file named "DXCC" as its database. If it's not given a full path then it opens it in the directory the command prompt is in when you run it. If the file you give it doesn't exist, then SQLite will create it after the first command that would require data to be written. So in whatever folder your command prompt opens up to there's probably a new file there called "DXCC". -Having file extensions off is a cause of many headaches. (Long running major pet peeve of mine that MS made it default to hidden) When you type "sqlite3 DXCC" you're telling it to use the file "DXCC". Specifically, you're telling it to use "DXCC.db" or "DXCC.sqlite" or "DXCC.something". You need to give it the exact file name. So if you have an existing file in there called "DXCC.db" where Windows "recognizes" the file type and hides it in Windows Explorer, and you type "sqlite3 DXCC" then it's not going to open the .db file, it'll make a new extensionless "DXCC" file. So, however you get to "Folder Options" in Windows 10, go there, then to the View tab, then make sure "Hide extensions for known file types" is turned off. -If you have Windows Explorer open you can open a new command prompt right to a specific folder by holding shift and right clicking on the folder, then select "Open command window here". This is an alternative to cd-ing to the folder from a default starting location. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Alan Sent: Thursday, August 25, 2016 1:59 AM To: SQLite mailing list Subject: Re: [sqlite] sqlite importing csv I have created a directory for the project I am working on, and the Database and the csv file both reside in that directory. I right Clicked on start and selected the windows cmd, and as I understand it at the moment by typing sqlite3 DXCC then it should be sitting in the directory or folder that the DXCC database is in so should accept the sqlite command to import the csv file that is also sitting in that directory. I also tried it with the Admin cmd. On 25-Aug-16 16:38, Scott Robison wrote: > On Aug 24, 2016 10:25 PM, "Alan" wrote: >> forgot to reply to one of the questions. >> >> I am using version 3.13.0.0 and it is 64 bit >> >> I am running Windows 10 Pro >> >> computer is intel I3 3.5Ghz with 8Gb RAM. >> >> As my friend has no problem loading the same csv file with his Windows7 > computer >> I am guessing that it may be to do with running Windows 10. > What directory are you in? Are you using an elevated command prompt? > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
After opening your command prompt type: cd C:\jt65logger Then start SQLite and try importing your csv file. I see JT65 and DXCC, so I know this is ham related. Contact me directly if you'd like to discuss the ham aspects of your project. -- Bill Drago - W2KWD Staff Engineer L3 Narda-MITEQ 435 Moreland Road Hauppauge, NY 11788 631-272-5947 / william.dr...@l-3com.com > -Original Message- > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On > Behalf Of Alan > Sent: Thursday, August 25, 2016 3:40 AM > To: sqlite users > Subject: Re: [sqlite] sqlite importing csv > > By the way I have a folder C:\jt65Logger that contains all the databases etc > to > do with the project. > > > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users CONFIDENTIALITY, EXPORT CONTROL AND DISCLAIMER NOTE:This e-mail and any attachments are solely for the use of the addressee and may contain information that is privileged or confidential. Any disclosure, use or distribution of the information contained herein is prohibited. In the event this e-mail contains technical data within the definition of the International Traffic in Arms Regulations or Export Administration Regulations, it is subject to the export control laws of the U.S.Government. The recipient should check this e-mail and any attachments for the presence of viruses as L-3 does not accept any liability associated with the transmission of this e-mail. If you have received this communication in error, please notify the sender by reply e-mail and immediately delete this message and any attachments. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
On 2016/08/25 9:35 AM, Alan wrote: Simon, I entered what you asaked and no, that file is in the users\John directory so I guess that the cmd sqlite3 DXCC is not shifting the focus to the directory that the DXCC database is in and i would need to be using some other set of commands to make that happen SQLite3.exe cannot (and shouldn't) shift focus of a folder. It can only access the DB file in the specified folder. You have to specify the folder of the imported file also. Since you noted newness - let me offer a quick word of advice - there is a chance the Windows "We'll protect your data from you" UAC virtualising will mess with your data in future if the program will run in anywhere deemed unsafe. You should start off with creating your data folder in the User space (C:\Users\yourUser\Appdata\Roaming\yourAppFolder\) to enjoy smooth sailing. There's a CMD shortcut to this directory of the user's too (I forgot now the actual name, but google can tell you). Cheers! Ryan ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
By the way I have a folder C:\jt65Logger that contains all the databases etc to do with the project. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
Simon, I entered what you asaked and no, that file is in the users\John directory so I guess that the cmd sqlite3 DXCC is not shifting the focus to the directory that the DXCC database is in and i would need to be using some other set of commands to make that happen Alan On 25-Aug-16 16:45, Simon Slavin wrote: On 25 Aug 2016, at 4:03am, Alan wrote: attempt to import a short test Excel table of two columns with about 4 records in it, the main one I was trying to import had the same trouble with, it had over 300 records in it with two columns. Issue this command: sqlite3 DXCC.sqlite then inside the SQLite shell tool do the following: CREATE TABLE testTable (testColumn TEXT); .once testoutput.txt .schema .quit Do you find a new file called 'testoutput.txt' in the same folder as your anr.csv file ? Assuming that you /do/ get the file you expected ... Open anr.csv using NOTEPAD. Does the file look like comma-separated values to you ? Is the top line a line of data (probably numbers) or does it have column names ? You're importing the data in that file into a table. Have you already defined the table in your SQLite database before you issue the .import command or are you expecting SQLite to create the table for you ? Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
after clicking on the command it is in C:\users\john after typing sqlite3 DXCCit shows sqlite> if I then enter cd it shows ...> On 25-Aug-16 18:01, Simon Slavin wrote: On 25 Aug 2016, at 6:59am, Alan wrote: I right Clicked on start and selected the windows cmd, and as I understand it at the moment by typing sqlite3 DXCC then it should be sitting in the directory or folder that the DXCC database is in I don't think this is correct. Once you have started cmd instead of starting 'sqlite3', use this command 'cd'. It reports your current directory. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
I was just going to suggest that - if it is the default directory - windows will start the command prompt in the C:\users\. As long as the csv file is in this directory (but more than likely it is in the C:\users\\Documents directory. Delvin -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Thursday, 25 August, 2016 01:02 To: SQLite mailing list Subject: Re: [sqlite] sqlite importing csv On 25 Aug 2016, at 6:59am, Alan wrote: > I right Clicked on start and selected the windows cmd, and as I understand > it at the moment > > by typing sqlite3 DXCC then it should be sitting in the directory or folder > that the DXCC database is in I don't think this is correct. Once you have started cmd instead of starting 'sqlite3', use this command 'cd'. It reports your current directory. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
On 25 Aug 2016, at 6:59am, Alan wrote: > I right Clicked on start and selected the windows cmd, and as I understand > it at the moment > > by typing sqlite3 DXCC then it should be sitting in the directory or folder > that the DXCC database is in I don't think this is correct. Once you have started cmd instead of starting 'sqlite3', use this command 'cd'. It reports your current directory. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
I have created a directory for the project I am working on, and the Database and the csv file both reside in that directory. I right Clicked on start and selected the windows cmd, and as I understand it at the moment by typing sqlite3 DXCC then it should be sitting in the directory or folder that the DXCC database is in so should accept the sqlite command to import the csv file that is also sitting in that directory. I also tried it with the Admin cmd. On 25-Aug-16 16:38, Scott Robison wrote: On Aug 24, 2016 10:25 PM, "Alan" wrote: forgot to reply to one of the questions. I am using version 3.13.0.0 and it is 64 bit I am running Windows 10 Pro computer is intel I3 3.5Ghz with 8Gb RAM. As my friend has no problem loading the same csv file with his Windows7 computer I am guessing that it may be to do with running Windows 10. What directory are you in? Are you using an elevated command prompt? ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
On 25 Aug 2016, at 4:03am, Alan wrote: > attempt to import a short test Excel table > of two columns with about 4 records in it, the main one I was trying to > import had the same trouble > with, it had over 300 records in it with two columns. Issue this command: sqlite3 DXCC.sqlite then inside the SQLite shell tool do the following: CREATE TABLE testTable (testColumn TEXT); .once testoutput.txt .schema .quit Do you find a new file called 'testoutput.txt' in the same folder as your anr.csv file ? Assuming that you /do/ get the file you expected ... Open anr.csv using NOTEPAD. Does the file look like comma-separated values to you ? Is the top line a line of data (probably numbers) or does it have column names ? You're importing the data in that file into a table. Have you already defined the table in your SQLite database before you issue the .import command or are you expecting SQLite to create the table for you ? Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
On Aug 24, 2016 10:25 PM, "Alan" wrote: > > forgot to reply to one of the questions. > > I am using version 3.13.0.0 and it is 64 bit > > I am running Windows 10 Pro > > computer is intel I3 3.5Ghz with 8Gb RAM. > > As my friend has no problem loading the same csv file with his Windows7 computer > > I am guessing that it may be to do with running Windows 10. What directory are you in? Are you using an elevated command prompt? ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
forgot to reply to one of the questions. I am using version 3.13.0.0 and it is 64 bit I am running Windows 10 Pro computer is intel I3 3.5Ghz with 8Gb RAM. As my friend has no problem loading the same csv file with his Windows7 computer I am guessing that it may be to do with running Windows 10. Alan ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite importing csv
HI Guys really appreciate all your replies.What I am doing at present is to attempt to import a short test Excel table of two columns with about 4 records in it, the main one I was trying to import had the same trouble with, it had over 300 records in it with two columns. the test one has headers on both columns plus 4 lots of data, and I have tried importing it into an existing(empty) table called DXE and then also into a table not existing to see if it would add it. I have saved it under Excel csv comma delimited and the suffix of the file definitely says .csv when looking at the folder with windows file explorer. It is all part of a learning curve for me as I am trying to learn how to write small programs with windows forms and feeding data into about 22 different databases, this particular one I am going to try and use as a look up of information to be used elsewhere in other databases, (hope I am making sense) I am not a computer guru but trying to learn (LOL). Alan ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users