Telling the CsvProvider which line contains the column headers - f#-data

Is there a way to tell the FSharp.Data CsvProvider that the column headers are on the second rather than the first line?

This is not currently supported, but it sounds like something that could be added. Feel free to submit a feature request, or even better a pull request :-).
It would be useful to know more details (it is not exactly standard format of CSV files). Is there something on the first line, or is it blank (we could just skip all blank lines at the beginning....) or is there some sort of "comment"?

You can use the SkipRows parameter for that:
http://fsharp.github.io/FSharp.Data/reference/fsharp-data-csvprovider.html

Related

How to group more than one line of text with the datacap?

I have this document and i want to capture more than one line.I'm only managing to capture just one.
I am interested in getting all the content in blue.
Image from my script -
Result I want to get -
Using at least datacap 9.1.1 i think you would maybe want something like:
RegExFind_InBlock("objectivo")
GoNextWord("1")
SelectParentBlock()
UpdateFieldWithBlock()
Depending on how your recognize action works, you may need to use SelectParentBlock() a few times

Using VLookup to create a functional DATE() format output

Here is the deal, I am dealing with some really shoddy output, and no I can't correct this... it's not my data. I just have to work with it.
Here is what I want to do, because this needs to kill two birds with one stone.
I need to use VLookup to look up a ticket, once it looks up the ticket it needs to output a date. The date though is stuck between a universal "date" string...
2019-06-10T17:20:28+00:00
This string is in tab Ticket_Import in row O.
Now, I need to translate to a date that can be later sifted through and put into a chart. The only way I can figure out to do this is using DATE()
Now, here is my problem. I have figured out how to do it...mostly. I am just getting the wrong date back in return, I think it's skipping the data and just saying "Good luck jr." in it's own way...
Here is my formula:
=XLOOKUP(A1261,Ticket_Import!B:B,DATE(LEFT(Ticket_Import!O:O,4),MID(Ticket_Import!O:O,6,2),MID(Ticket_Import!O:O,8,2)),"Empty")
Now, I took this one specifically because I need the date to show up so it will be searchable, which I am not even sure if this will work or not.
The XLOOKUP is searching for the number in A1261, which is 2690.
2690's O row output is
2019-06-10T17:20:28+00:00
Now, when I use this script I wrote it shows as an end result 2019-12-31 instead of 2019-06-10
Which is telling me it can't output properly...
Can someone help me out with this and explain or show me how to get this actually working properly?
Like I said, I can't edit the raw data, but I can make the data output be whatever it needs to be to make this work... as long as I can understand it and reproduce it, because I have to do this over 4,000 more times...
Realistically, once this is done I am going to be copying and pasting the output anyway through a VBA script so that this will not be such a resource hog in the future. I am playing catch up to something that needed to be done ages ago...
Any help would be greatly appreciated.
Thanks!
Solved it...! (YAY ME!)
Ok, I know immature, but this was causing me no end of grief...
The proper code is:
=XLOOKUP(A1261,Ticket_Import!B:B,DATE(LEFT(Ticket_Import!O:O,4),MID(Ticket_Import!O:O,6,2),MID(Ticket_Import!O:O,9,2)),"Empty")
I had an improper mid alignment for the day.
Thanks for everyone that had a chance to look at and and scratch their heads for a minute or two... either way, This is also good for people to use later if they need to make it work for them as well!

Search Algorithm for a web application that needs to look for a specific value

I'm developing a webapp that will need to download the html form a website and then iterate through the code and try to find a specific but ever changing value (in our case it will be the price for the product).
For this, I was thinking about asking the user (upon installation and setup) to provide the system with a few lines of html from the page (that has the price) and then from then on, every time we need to fetch the price we would try to search for those lines and find the price.
Now, I believe this is a horrible and slow way of doing this and since there are no rules and the html can be totally different from one website to another (even the same website might change) I couldn't find a better way.
One improvement that I thought about was to iterate through the first time and record the line at which we find the code. Once found, the subsequent times we would then start from a few lines before the expected location and start the search. Any Thoughts on how I can improve on this?
I posted this question on https://cstheory.stackexchange.com/ but they commented that it's not on topic and that I should post it here.
I have the code for the above and if needed I can post it, I'm simply thinking that there must be a better, faster way of doing this.
This is actually something I tried for a project recently (using BeautifulSoup and Python). The solution that worked for me was to workout CSS selectors (which can map to jQuery selectors) that targeted the elements that contained the values I was looking for. In my case I was able to narrow down the full document to just the elements that contained what I was looking for but if you couldn't get exactly what you where after you could combine this with some extra lactic like test to see if it looks like a price (via regex) or test what it is next to.

Best non-interactive approach to enter a string into a formular field and get the resulting text

In some website for which I have access, there are some input fields. In the sixth field I need to enter some input string from a list of 10000 strings, then a new page appears, for which I would just need to count the number of lines. Finally I would like to get a table with two columns like input string and number of resulting lines. Since I have to manually enter the info for all the different 10000 strings, I wonder therefore what is the best approach to enter a string into a generic formular field and get the resulting text. I heard about curl but I am not sure whether this is the easiest one.
P.S.
Example of interactive way: I type some string o words into google search and then I get a new page with the search results. Previously I have introduced my google username and password, so the results will be probably filtered according to my profile.
Example of non-interactive way: A script somehow introduces my user information, search query and saves to some text file the search results. Imagine the same idea but for a more complicated website like this.
What you want to do is to send a HTTP POST with specific data. This can be done with any proper HTTP client code, and one such is libcurl (or the pycurl binding or even using the curl command line tool). On the response from the post, you probably get a redirect and then the results, or you need to do a separate request for the results and then you're done and go back to do the next POST. Repeat until all POSTs are done.
What you may need to take into account is that you may have to deal with cookies and possibly to follow a redirect from the POST. A good approach is to record a "manual session" as done with a browser (use firebug or LiveHTTPHeaders etc) and then use that recording to help you repeat the same thing with a HTTP client.
A decent tutorial to get some starting up details on this kind of work can be found here: http://curl.haxx.se/docs/httpscripting.html
You could also use JMeter to run all the posts. You may use the CSV input to set the 10000 strings. Then you save the result as xml and extract the necessary data.

Setting a TextFilter's value from a Query String (URL) Filter

I'd like to start off by saying I'm very new to Sharepoint, so I'm sorry if I'm asking something very obvious. I've done quite a bit a googling and can't find an answer to my question. This leads me to believe that maybe I'm asking the wrong question. So, here goes:
We have a Sharepoint webpage that currently contains 3 Web Parts (2 lists and a text filter). The text filter can be used to filter the two lists. I've been asked to provide the following functionality:
A user must be able to open this page from an http link (easy)
The Text-Filter must be automatically filled-in and applied, thus immediately filtering the two lists
This seemed pretty straight-forward to me: Pull a parameter from the page's URL and feed it into the filter.
I found and added a Query String (URL) Filter and I managed to pull the parameter from the URL, but I can't feed it to the existing Filter!
Sure, I can pass the value to the two lists (effectively coding the same filter two different ways) but that seems wrong. So, my question boils down to this:
Is it possible to set a Text Filter's value from a Query String (URL) Filer?
Am I asking the wrong question? Am I looking at this problem in the wrong way? Any help is much appreciated, thanks.
I was asking the wrong question!
It seems you can set a Text Filter's value on page-load through the URL. Here's how:
http://sharepoint-server/site/subsite/project/default.aspx?Text%20Filter%20Name=999
Where Text%20Filter%20Name is the name of your Text Filer (in this case, with spaces in the name), and where 999 is the value you're passing to the filter.

Resources