The goal is to convert a Fox Pro script to SQL. At the moment, we import the items into Fox Pro and then subdivide and manipulate according to a script that was developed 12 years ago.
It starts out like this
use xyz4digit.dbf
Append from S:/file location
Append from S:/2 - file location
From there, xyz4digit is built by appending various files. The same is done for 2, 3, 5, and 6 digit. Prior to this, we have 6 blank databases with identical structure. xyz4digit, 2, 3, 5, 6, and result.
Basically, I want to know if there is a process like this in SQL. The blank databases are on my local machine if this helps.
Related
I have a very simple iseries AS400 DDS file defined in this way
A R U110055R TEXT('POSITIVE PAY')
A ACCT55 9A
A SERL55 10A
A ISSD55 10A
A AMT55 13A
A NAME55 50A
I am using Data Transfer from System i (IBM I Access for Windows V6R1)
to output a csv to the desktop. It will then be used by our banking
PC software. I cannot find a setting or a file type that will yield
the data without leading blanks. It consistently holds the file sizes
of the Database file (without trailing blanks).
I need:
"192345678","311","07/22/2016","417700","ALICE BROWN CO."
"192345678","2887","07/22/2016","4124781","BARBIE LLC."
"192345678","2888","07/22/2016","4766","ROBERT BLUE, INC."
"192345678","2889","07/22/2016","71521","NANCYS COOKIES, INC"
"192345678","312","07/22/2016","67041","FRANKS MARKET"
But I get:
"192345678"," 311","07/22/2016"," 11417700","ALICE BROWN CO."
"192345678"," 887","07/22/2016"," 4124781","BARBIE LLC."
"192345678"," 888","07/22/2016"," 3204766","ROBERT BLUE, INC."
"192345678"," 301","07/22/2016"," 2971521","NANCY, INC"
"192345678"," 890","07/22/2016"," 967041","FRANKS MARKET"
The Data Options button of the Data Transfer from IBM i application brings up a window where you can explicitly specify the SQL statement used to extract data.
You can use the SQL TRIM() function there...
Limitation of DDS:
Use of TRIM in DDS
The answer seems to be "You can't." If I were doing this, I'd probably
create a SQL VIEW with a DDL statement rather than try to get it done
with DDS.
Solution: (W3School) or (IBM Knowledge Center)
CREATE VIEW U110055V1 as
SELECT TRIM(ACCT55),
TRIM(SERL55),
TRIM(ISSD55),
TRIM(AMT55),
TRIM(NAME55)
FROM U110055
RCDFMT U110055V1R;
Suggestion:
Export the newly created View to a .CSV file (refer here or here)
Share the IFS file on the network for easy consistent automated access, (No manual export with i Access required).
Recently I started a project, but now i have a little problem.. I need to make a point system:
When user write a post(like blog post), his post is analyzed by a script( using keyword from database).
The problem is that my keyword have to be on 10 levels.
For ex:
Keyword Level 1 = angry
Keyword Level 2 = be happy
Ok.. when i write :" I'm so angry today" I need to receive level 1(but just in background to use that result for arrange the sentence "I'm so angry today" to his level.
Can somebody help me? (MySql)
Have a nice day!
I really like to create/delete/disable (and all other actions to breakpoint) multiple breakpoints in just one command line, such as:
b 12 28 30
to create 3 breakpoints at line 12, 28 and 30.
I googled many times, but got nothing.
The only built-in way to create multiple breakpoints with a single command is rbreak, but this isn't applicable to you, as it doesn't allow line numbers.
If you really need this for some reason, you can write a new command to do it. You might be able to do this from the CLI using define, but, if not, you can easily use Python to write new commands.
Many other breakpoint commands like enable (but not all commands -- I think, e.g., not cond for syntax reasons) take a list of breakpoints to work on.
In julia when a function is called it automatically prints the output to the console i.e.
julia> [1:10]+5
10-element Array{Int64,1}:
6
7
8
9
10
11
12
13
14
15
I'm using Gadfly's plotting functions, which creates a plot. The output looks atrocious though. I don't want to completely suppress the output though (I think that can be done using the ;). I want to retain the summary portion (in the above example 10-element Array{Int64,1})
How can I do that?
If I'm understanding you correctly, the simple solution is to define a show method for Gadfly's plots:
Base.show(io::IO,p::Gadfly.Plot) = print(io, summary(p))
You can make it more complicated to show more information about p if you wish. In most cases, though, I think Gadfly should actually generate an image of the plot and show it to you (through the richer display mechanism).
I have a PGN (Portable Game Notation) of a chess game. What I would like is to get just a list of the moves. For example:
PGN :
1. e4 e5 2. f4 exf4 3. Nf3 d5 4. exd5 Nf6 5. Nc3 Nxd5 6. Nxd5 Qxd5 7. d4 Bg4 8.
Bxf4 Nc6 9. Be2 O-O-O 10. c3 Qe4 11. Qd2 Rxd4 12. Nxd4 Nxd4 13. cxd4 Bb4 14.
Kf2 Bxd2 15. Bxg4+ f5 16. Bxd2 fxg4 17. Rhe1 Qxd4+ 18. Be3 Qxb2+ 19. Kf1 Re8
0-1
output:
['e4','e5','f4','exf4','Nf3','d5', .... , 'Re8']
My idea was the take the string and split it at the spaces and then arrange a new array that way, but I'm wondering if there are any better ways of doing this. There's no specific language I'm just interested in general. Could be python, javascript, doesn't really matter.
Also, sometimes PGN comes with notation in the middle of the string or "variations" which are denoted in brackets, I'd like to ignore these. Any ideas?
Thanks
Strange, I couldn't find good PGN parsers for Ruby or Javascript. Here are two other libraries that I briefly tested:
PHP: https://github.com/DHTMLGoodies/chessParser (seems to be broken; when I tried I always got an empty array of games)
Perl: http://metacpan.org/pod/Chess::PGN::Parse
(seems to work, at least I could see the moves of a PGN game. Not easy to get started, though.)
Maybe it is really the best approach to write the parser yourself. You can eliminate the comments with regular expressions as they are not nested.
(from Wikipedia)
Comments are inserted by either a ";" (a comment that continues to the end of the line) or a "{" (which continues until a matching "}"). Comments do not nest.
After the comments (including the variants) are gone, you can parse the moves as you intended (split for whitespaces and filter the move numbers).
I've just started using the Ruby PGN gem at https://rubygems.org/gems/pgn It has a parser module, you can do PGN-> FEN, play through the game, set up positions with FEN import, etc. i've been using a branch of this as well at https://github.com/tobiasvl/pgn/tree/pgn-annotations this branch is able to parse PGNs containing variations and comments.
Here's a javascript version, https://github.com/jhlywa/chess.js