Read EDI X12 File and convert Using Talend Open Studio - talend

I am new to EDI. I got some information about EDI from Here. I heard that Talend supports reading of EDI X12 files using some technique called Smooks. I downloaded
Talend Open Studio for Data Integration v5.3.1. But I don't know how to Use it for reading EDI file
I got a EDI text from one site
ISA*00* *00* *12*3109992367T *ZZ*IAISNOKIST *070103*0839*^*00307*000024398*0*P*>~
GS*OG*3109992367*IAISNOKIST*20070103*0839*24398*T*004010UCS~
ST*875*000024479~
G50*N*20071230*59590001~
G62*10*20070106~
NTE*GEN*59590001~
NTE*GEN*IF ANY CHANGES OR SHORTAGES PLEASE~
NTE*GEN*CONTACT ALLY SMITH (310) 256-9388~
NTE*GEN*OR EMAIL ASMITH#AOL.COM~
G66*CC*H~
N1*BT*UNIFIED WESTERN GROCERS*9*0063333040005~
N3*PO BOX 11111 TERMINAL WAY~
N4*LOS ANGELES CA 900250000~
N1*ST*CGC MECHANIZED WAREHOUSE*9*0069333040180~
N3*1200 SHEILA AV~
N4*COMMERCE CA 900400000~
N1*BO*MY COMPANY NAME*9*193807245~
G68*10*CA*1.57*006121100201~
G69*SPRINGFIELD APPLESAUCE~
G70*1*5*OZ~
G68*10*CA*3.98*006121100202~
G69*SPRINGFIELD FANCY APPLESAUCE~
G70*1*5*OZ~
G76*100*CA~
SE*23*000024479~
GE*1*24398~
IEA*1*000024398~
I want to save this as a EDI file. What should be its extension? And is there any link for steps or demo for using Talend to read this file and parse it to some readable file like CSV or XML?
Thanks

Not many people seems to remark this, but Talend Open Studio for Data come with a default project called Demo project (see picture below).
This project contains tons of examples of how to use Talend. You should find everything there. Every job is very well documented, example :
Official online documentation can be found here : http://www.talendforge.org/tutorials/menu.php (free registration may be required at some point)

Related

Add directory to Kodi using the command line

Is there possible to add a directory to Kodi using the command line? I've been looking for this with no luck so far.
What I'm looking for is to automate the process of adding a directory manually using command line. For some reason this doesn't appear to be a popular question out there; am I missing something?
Crawling the Kodi/XBMC forums and wiki show a few options... Here's what I've gathered...
Edit the Database Directly (not recommended)
Kodi stores this information in a sqlite database, however this location would be pretty tricky to manipulate yourself as it would require both knowledge of the path of each sqlite database file as well as the relationship of each column/table in each database file (assuming it's a strictly relational database file, which most are).
For example:
sqlite3 <path_to_kodi_preferences>/userdata/Database/MyVideos119.db
sqlite> .tables
actor movie_view studio_link
actor_link movielinktvshow tag
art musicvideo tag_link
bookmark musicvideo_view tvshow
country path tvshow_view
country_link rating tvshowcounts
director_link season_view tvshowlinkpath
episode seasons tvshowlinkpath_minview
episode_view sets uniqueid
files settings version
genre stacktimes writer_link
genre_link streamdetails
movie studio
Edit sources.xml
The official wiki mentions <path_to_kodi_preferences>/userdata/sources.xml for this but it still assumes you know how to manipulate an XML file programmatically and the community warns that this is potentially "invasive" and that the official addons/plugins aren't allowed to use this technique.
I dove into this and the XML seems like the way to go, for example, to add Videos:
<video>
<default pathversion="1"></default>
<source>
<name>Movies</name>
<path pathversion="1">/home/ubuntu/Movies/</path>
<allowsharing>true</allowsharing>
</source>
<source>
<name>Video Playlists</name>
<path pathversion="1">special://videoplaylists/</path>
<allowsharing>true</allowsharing>
</source>
+ <source>
+ <name>MyCustomDirectory</name>
+ <path pathversion="1">/home/ubuntu/MyCustomDirectory/</path>
+ <allowsharing>true</allowsharing>
+ </source>
</video>
... however comments suggest Kodi needs to be restarted and that this location still needs to be crawled/refreshed. There may be some "watchdog" add-ons that can do this for you.
Use the Add-On API
Another technique is to use the official Python API, such as through UpdateLibrary(database, path) however examples usually involve Python to call the API directly. Here's an example from the PlexKodiConnect GitHub project:
# Make sure Kodi knows we wiped the databases
xbmc.executebuiltin('UpdateLibrary(video)')
if utils.settings('enableMusic') == 'true':
xbmc.executebuiltin('UpdateLibrary(music)')
Since the simplest solution is often the best, I would recommend working on a way to automate the settings.xml file. Modifying XML files is well-documented in nearly all programming languages (to that point, you could technically brute-force and just inject an XML string at the given place without an xml parser 😈) and then handle the restart and refresh operations once the XML is confirmed as being updated properly.

Zip Exception Wrong CRC value when opening a ZIP file - Syncfusion

I have a password protected zip file with 3 folders PFC, STA and SYS. The zip file when loaded for the first time reads all the text files in the PFC folder and display the data onto the screen. I perform some operations on the screeen which generates new files and they are added into the STA and SYS folders and the same initial zip file is updated.
However, when I try to load the same zip file which now should have the all the initial files and folders along with the newly created files in it, it gives me a Wrong CRC Value error. I dont know what am I doing wrong.
We have tried to reproduce the issue by preparing a sample with your scenario. But, we are facing another issue related to password which we will fix in our upcoming release. The sample can be downloaded from the below link .
Sample link : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Password-1299200154.zip
Kindly modify the sample to reproduce the “CRC value error” issue and update us along with input documents. It will help us to analyze further on this and provide you a solution at earliest.
Note : I work for Syncfusion.
You can send your sample or confidential information in mail to, support#syncfusion.com
Regards,
Mohan.

How to download a file (csv.gz) from a url using Python 3.7

As with others who have posted in the past, I cannot figure out to download a csv.gz file from a URL in Python 3.7. I see posts but they only post a 2kb file.
I am a 100% newbie using Python. What follows is the code for one file that I am trying to obtain. I can't even do that. The final goal would be to request all files that start with 2019* using python. Please try the code below to save the file. As others stated, the file is just a name without the true content - Ref: Downloading a csv.gz file from url in Python
import requests
url = 'https://public.bitmex.com/?prefix=data/trade/20191026.csv.gz'
r = requests.get(url, allow_redirects=True)
open('20191026.csv.gz', 'wb').write(r.content)
Yields:
Out[40]:
1245
I've tried "wget" and urllib.request along with "urlretrieve" also.
I wish I could add a screenshot or attach a file. The file created is 2kb and not even a csv.gz file. But the true file that I can download from a web browser is 78mb. The file is 20191026.csv.gz not that it matters as they all do the same thing. The location is https://public.bitmex.com/?prefix=data/trade/
Again, if you know of a way to obtain all the files using a filter such that 2019*csv.gz would be fantastic.
You are trying to download the files from https://public.bitmex.com/?prefix=data/trade/.
To achieve your final goal of download all the files starting from 2019* you have to do in 3 steps
1) you read the content of https://public.bitmex.com/?prefix=data/trade/
2) convert the content into an list, from that filter out the file names which starting from 2019.
3) from the result list try to download the csv using the example which you referring.
Hope this approach will help you
Happy coding.

Executing g-code from file within a ST-program in the software Automation Studio from B&R

I have a 3-axis system, which resembles the CNC-axis, and a PowerPanel from B&R. Now I plan to execute the g-code, which I read from a file, which is fe located in the Downloads folder. This will be done with fbs from B&R Automation Studio.
I got confused with the help, since it says in drive engineering/mapp Motion/technologie/function block/mpcnc3axis/description the part of moveProgram, where it redirects you to MC_BR_MoveProgram \ description. There stands that you can start the program with [Program name prefix] [File device name:] [Path] Program name syntax. Now I am not sure how to include this with my MpCnc3Axis code or if I can use the syntax also in MpCnc3AxisParType ProgramName part to start the program from fe Downloads Folder, since it didn't work with McPrgAdvParType InitProgramName.
Any links to related material would be appreciated.
I would also accept a solution with C, if it is easier.
Depending on if you are willing to buy software licences from B&R, running a CNC system is more or less easy.
The state of the art implementation is with mappMotion. It requires software licenses and gives you ready to go FUBs to execute nc files, jogging, direct movements, etc. This works the same way for different robot types and CNC kinematics. I recently uploaded a small implementation of a robot on GitLab: https://gitlab.com/kirni/bur_robotic_sample
The alternative is the old ARNC0 approach. No more new features are implemented, but it is free - as long as you do not need any functions that require a Dual Use agreement (i.e. 5 Axis CNC, etc.). The implementation is rather complex and is definitely to extensive to be answered completely at stackoverflow.
However Automation Studio ships with a sample for a two axis CNC. In the logical view you can add a new object Library Samples which opens a dialog where you can select Samples/Motion/CNC system (2 axis)/LibARNC0_Basic_ST.zip. This would be the best starting point, which is also documented in the help in MotionControl/ACP10 ARNC0/Examples/CNC or guid: 4620bb1c-8694-4f27-87d0-805686d7c0c8 as of AS 4.4.4.64.
I hope this helps!

Write XLSX file - Oracle forms

i am trying to create xlsx file based on block data in oracle forms.
Is it possible to generate xlsx using webutil(Text_io) or by using java beans?
any sample please share me.
thanks
V
In my opinion and experience it is best using UTL_File to generate text file then open it with Excel. You can use Text_IO also. If I find the example I will post it.