docker run -rm -it -v $(pwd):/tmp textql Now use that image mounting your current directory into the container. Latest release on Homebrew (OS X) brew install textqlīuild from source go get -u /dinedal/textql/.įirst build the image. textql leverages the sqlite in-memory database feature as much as possible and only touches disk if asked.textql supports quote-escaped delimiters, sqlite does not.sqlite import will not accept stdin, breaking unix pipes.Key differences between textql and sqlite importing Writing to a directory no longer fails silently.Removed '-source', any files / paths at the end of the command are used, as well as piped-in data.This makes less sense after the automatic tablename generation based on filename, joins, and shorter SQL syntax changes. Dropped the ability to override table names.The flag '-outputHeader' was renamed to '-output-header'.This means the v1 command textql -sql "select * from tbl" -source some_file.csv can be shortened to textql -sql "*" some_file.csv.For simple selects, the SELECT keyword can be dropped from the query.For the case of a single table, the FROM can be dropped from the query.Added flag '-output-dlm' to modify the output delimiter.Added flag '-output-file' to save output directly to a file.You can list as many files / directories as you like.Directories are read by reading each file inside, and this is non-recursive.Added join support! Multiple files / directories can be loaded by listing them at the end of the command.See Time Strings for a list for accepted formats, and how to convert from other formats. Date / Time / DateTime values are automatically recognized in reasonable formats.Numeric values are automatically recognized in more cases.There've also been additional performance tweaks and added functionality, but this comes at the cost of breaking the original command-line flags and changing the install command. In the time since the initial release of textql, I've made some improvements as well as made the project much more modular. This must be changed to the use the path of the actual filename.Allows you to easily execute SQL against structured text like CSV or TSV. In your case the command would be: textql -sql "select * where c3=30 and c4=25 and c1>=152 and c1 You can install it using the following command (I believe it's only available as of 18.04 or else you would need to install in another way, docker, or from source): sudo apt install textql You can use the TextQL library to write SQL queries in order to extract data from a text file. I'd like to extract all rows and then write data to text file, which is D= 30 and E=25 and B>=152 and B=152 & data(i,2)<=241įprintf(fileID,'%d %d %d %d %d %3.1f \n',data(i,:)) A,B,and C column start over after 499,440 rows.Values of D column begin with 30 and end with 45 and consecutively increase by 2.5 after 499,440 rows following.Values of E column begin with 25 and end with 45 and consecutively increase by 5 after five rows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |