I am very new to html and JavaScript.
My project is to make a website in html that can search excel for user-defined criteria and display results back in the webpage.
Example: a user searches the ID number #1234, and the website then displays information like name, location, gender etc. That correspondences with that ID number (ID number in col A).
The data is in excel, typically one row per unique ID. And is currently in xlsx format but this can be changed.
Sorry for the lengthy question and lack of coding example. I have searched many different options however I cant even get those to work.
Any direction or help on this would be greatly appreciated.
In my opinion, this is going to be a monumental task if you are beginning. I'd say you should start with a smaller project. Especially since you don't know where to start / what to search for on google. If however you can convert your data to json (assuming you own the data), that will be more reachable.
If you want to do it with excel data anyway, with javascript, there is this parser for spread sheet that can help you:
Parser and writer for various spreadsheet formats. Pure-JS cleanroom
implementation from official specifications, related documents, and
test files. Emphasis on parsing and writing robustness, cross-format
feature compatibility with a unified JS representation, and ES3/ES5
browser compatibility back to IE6.
This is the community version. We also offer a pro version with
performance enhancements, additional features by request, and
dedicated support.
Related
I have an apparel list in Google Sheets with the following columns:
This is only a little part of it. It actually has over 9K items. So here's the thing, I have to manually search each of those legacy numbers on a HTML list provided by the client, which looks like this:
As you can see on the last column, there are some texts like "Completed", "Customer Review", etc. Those values have to be parsed on the google sheet "Status" column. After reviewing some orders and copying those values, the sheet looks like this:
Now, imagine doing this process individually with 9K+ orders, it's a pain in the ass. So I thought there could be a way to automatize this, maybe parsing the values from the HTML through some Javascript to a CSV or anything similar. I've been doing some research but haven't found anything. I'm not asking you to do the job for me. I'm looking for a hint to start this correctly, as it would make a lot easier and faster the work.
Note: this "automatization" isn't a task or job requested to me, I'm a designer (with some programming background) and I have to do the manual process with a deadline, so I thought I could try and speed up this.
Thanks in advance.
I would try using IMPORTHTML so you can add the data from the HTML list on a different tab in Google sheets and then perform an INDEX MATCH or an ArrayFormula to get the data that you need.
There are many ways to compare the data that you need using different formulas, if you can create a demo sheet we could help you finding a formula that could perform the query of the data that you need. As a friendly reminder always try to include a minimal example that reproduces the issue. That way we can provide better insights about what you want to achieve.
I have been assigned to a project to translate various texts in quite large IBM BPM processes (large numbers of coaches with literals text and activities with JavaScript content eg. setting error-messages). Therefore I would like to "extract" all contents of a given Process App in a structured manner. The different processes, their activities, the Javascript, the text-literals they contain etc.
I have found out, that I can export a process, but the twx-file does seem to be IBM-internal format only. One cannot even find a literal text inside the file.
I have read about the JavaScript types like TWProcess, TWTask etc. and from their description it seems it should be possible, but I cannot get it to work. Eg the
tw.system.model.findProcessByName(<a name>).steps
returns
"No variable type found for type name: Step".
Using
tw.system.model.findProcessByName(<a name>).name
works fine and returns the expected name.
Does anyone have a piece of JavaScript that could traverse the definition of processes in an IBM BPM Process App? Or is the JavaScript in IBM BPM only for controlling the activities and show status and content of running processes?
The .twx file is actually simply a zip file of what amount to XML files. You can parse them if you really need to, but doing so is fairly complex. We have written code to do this for static code analysis of IBM BPM solutions. Neches is our static code analysis tool for IBM BPM that parses this data into a custom data schema to allow us to do analysis across BPM solutions. I believe we either have the data you need there or can get it.
In the interest of sharing, the data you want will likely be either the coach files or the coach view files. These can be identified as they coaches file names will be 2025.some guid.xml and coach view will be 64.some guid.xml
Our company can help answer this question if you are interested.
I have a question about how to approach a certain scenario before I get halfway through it and figure out it was not the best option.
I work for a large company that has a team that creates tools for the team mates to use that aren’t official enterprise tools. We have no access to the database directly, just access to an internal server to store our files to run and be able to access the main site with javascript etc (same domain).
What I am working on is a tool that has a ton of options in it that allow you to select that I will call “data points” on a page.
There are things like “Account status, Balance, Name, Phone number, email etc” and have it save those to an excel sheet.
So you input account numbers, choose what you need and then using IE Objects it navigates to the page and scrapes data you request.
My question is as follows..
I want to make the scraping part pretty Dynamic in the way it works. I want to be able to add new datapoints on the fly.
My goal or idea is so store the regular expression needed to get the specific piece of data in the table with the “data point option”.
If I choose “Name” it knows the expression for name in the database to run again the DOM.
What would be the best way about creating that type of function in Javascript / Jquery?
I need to pass a Regex to a function, have it run against the DOM and then return the result.
I have a feeling that there will be things that require more than 1 step to get the information etc.
I am just trying to think of the best way to approach it without having to hardcode 200+ expressions into the file as the page may get updated and need to be changed.
Any ideas?
IRobotSoft scraper may be the tool you are looking for. Check this forum and see if questions are similar to what you are doing: http://irobotsoft.org/bb/YaBB.pl?board=newcomer. It is free.
What it uses is not regular expression but a language called HTQL, which may be more suitable for extracting web pages. It also supports regular expression, but not as the main language.
It organizes all your actions well with a visual interface, so you can dynamically compose actions or tasks for changing needs.
I am just a newcomer developing an app with html/css/js via phonegap. I've been searching info on how to make my app be displayed in different languages and Google doesn't understand me.
So the idea is to have a button on index.html that let the user choose the language in which the app will be displayed, in this case Spanish/English, nothing strange like arabic blablabla....
So I guess that the solution must be related to transform all the text that I load in html to variables and then depending on the language selected display the correct one. I have no idea how to make this, and Im not able to find examples. So that's what Im asking for... if someone could give some code snipet to see how html variables works and how should I save user language selection...
Appreciated guys!
This can be done by internationalization (such as i18N). To do this you need separate file for each language and put all your text in it. Search Google for internationalization.
Otherwise you can look into embeding Google Translate.
This depends on the complexity of language-dependencies in the application. If you have just a handful of short texts in a strongly graphic application, you can just store the texts in JavaScript variables or, better, in properties of an object, with one object per language.
But if you expect to encounter deeper language-dependencies as well (e.g., displaying dynamically computed decimal numbers, which should be e.g. 1.5 in English and 1,5 in Spanish), then it’s probably better to use a library like Globalize.js (described in some detail in my book Going Global with JavaScript and Globalize.js). That way you could use a unified approach, writing e.g. a string using Globalize.localize('greeting') and a number using Globalize.format(x, 'n1') and a date using Globalize.format(date, 'MMM d').
I would like get meaning of selected word using wikionary API.
Content retrieve data should be the same as is presented in "Word of the day", only the basic meaning without etympology, Synonyms etc..
for example
"postiche n
Any item of false hair worn on the head or face, such as a false beard or wig."
I tried use documentation but i can find similar example, can anybody help with this problem?
Although MediaWiki has an API (api.php), it might be easiest for your purposes to just use the action=raw parameter to index.php if you just want to retrieve the source code of one revision (not wrapped in XML, JSON, etc., as opposed to the API).
For example, this is the raw word of the day page for November 14:
http://en.wiktionary.org/w/index.php?title=Wiktionary:Word_of_the_day/November_14&action=raw
What's unfortunate is that the format of wiki pages focuses on presentation (for the human reader) rather than on semantics (for the machine), so you should not be surprised that there is no "get word definition" API command. Instead, your script will have to make sense of the numerous text formatting templates that Wiktionary editors have created and used, as well as complex presentational formatting syntax, including headings, unordered lists, and others. For example, here is the source code for the page "overflow":
http://en.wiktionary.org/w/index.php?title=overflow&action=raw
There is a "generate XML parse tree" option in the API, but it doesn't break much of the presentational formatting into XML. Just see for yourself:
http://en.wiktionary.org/w/api.php?action=query&titles=overflow&prop=revisions&rvprop=content&rvgeneratexml=&format=jsonfm
In case you are wondering whether there exists a parser for MediaWiki-format pages other than MediaWiki, no, there isn't. At least not anything written in JavaScript that's currently maintained (see list of alternative parsers, and check the web sites of the two listed ones). And even then, supporting most/all of the common templates will be a big challenge. Good luck.
OK, I admit defeat.
There are some files relating to Wiktionary in Pywikipediabot and I looking at the code, it does look like you should be able to get it to parse meaning/definition fields for you.
However the last half an hour has convinced me otherwise. The code is not well written and I wonder if it has ever worked.
So I defer to idealmachine's answer, but I thought I would post this to save anyone else from making the same mistakes. :)
As mentioned earlier, the content of the Wiktionary pages is in human-readable format, wikitext, so MediaWiki API doesn't allow to get word meaning because the data is not structured.
However, each page follows specific convention, so it's not that hard to extract the meanings from the wikitext. Also, there're some APIs, like Wordnik or Lingua Robot that parse Wiktionary content and provide it in JSON format.
MediaWiki does have an API but it's low-level and has no support for anything specific to each wiki. For instance it has no encyclopedia support for Wikipedia and no dictionary support for Wiktionary. You can retrieve the raw wikitext markup of a page or a section using the API but you will have to parse it yourself.
The first caveat is that each Wiktionary has evolved its own format but I assume you are only interested in the English Wiktionary. One cheap trick many tools use is to get the first line which begins with the '#' character. This will usually be the text of the definition of the first sense of the first homonym.
Another caveat is that every Wiktionary uses many wiki templates so if you are looking at the raw text you will see plenty of these. The only way to reliably expand these templates is by calling the API with action=parse.