Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > alt.computer > #9990 > unrolled thread
| Started by | Robert Baer <robertbaer@localnet.com> |
|---|---|
| First post | 2016-07-05 11:50 -0800 |
| Last post | 2016-07-05 21:11 -0800 |
| Articles | 3 — 2 participants |
Back to article view | Back to alt.computer
javascript is so..... Robert Baer <robertbaer@localnet.com> - 2016-07-05 11:50 -0800
Re: javascript is so..... Paul <nospam@needed.com> - 2016-07-05 16:47 -0400
Re: javascript is so..... Robert Baer <robertbaer@localnet.com> - 2016-07-05 21:11 -0800
| From | Robert Baer <robertbaer@localnet.com> |
|---|---|
| Date | 2016-07-05 11:50 -0800 |
| Subject | javascript is so..... |
| Message-ID | <tcUez.2381$u64.948@fx09.iad> |
..impossibly opaque. There is a document open function/process/command/method [do not give a snap about the incomprehensible terminologies - care only about WHAT I CAN DO with it]. Almost zero info as to what eXactly (yes, X-rated) can be opened; fur [i am a baer, after all] eggzample, i would like to open a file to READ it. Ideally a function, READ file line by line in a little test loop. If line starts "Subject:" (no quotes), i know following info is an e-mail subject and i want to use the subject string to be compared with var Subj[] and a count that started at zero is incremented if a match. Next line starts "From:" (no quotes), has optional name _usually_ in quotes and to be compared with var SendName[] where count is incremented on a match; mail URL to be compared with var Address[] where count is incremented on a match. All following lines to be compared with var EBody[] where count is incremented on each match (if only one match allowed, that is acceptable) Function to be used on incoming e-mail file. I use count to issue various levels of warnings, as well as APPEND the Subject, From, and Date lines to a log file. I have a pretty good list in that log file, and have gleaned the match criteria for those arrays. So, in short, 1) how do open a SPECIFIC file, 2) how do i sequentially READ that file, 3) how do i know when i get to the end of the file so that the procedure does not crash, but gracefully close?
[toc] | [next] | [standalone]
| From | Paul <nospam@needed.com> |
|---|---|
| Date | 2016-07-05 16:47 -0400 |
| Message-ID | <nlh6dc$gf$1@dont-email.me> |
| In reply to | #9990 |
Robert Baer wrote:
> ..impossibly opaque.
> There is a document open function/process/command/method [do not give
> a snap about the incomprehensible terminologies - care only about WHAT I
> CAN DO with it].
> Almost zero info as to what eXactly (yes, X-rated) can be opened; fur
> [i am a baer, after all] eggzample, i would like to open a file to READ it.
> Ideally a function, READ file line by line in a little test loop.
> If line starts "Subject:" (no quotes), i know following info is an
> e-mail subject and i want to use the subject string to be compared with
> var Subj[] and a count that started at zero is incremented if a match.
> Next line starts "From:" (no quotes), has optional name _usually_ in
> quotes and to be compared with var SendName[] where count is incremented
> on a match; mail URL to be compared with var Address[] where count is
> incremented on a match.
> All following lines to be compared with var EBody[] where count is
> incremented on each match (if only one match allowed, that is acceptable)
> Function to be used on incoming e-mail file.
> I use count to issue various levels of warnings, as well as APPEND the
> Subject, From, and Date lines to a log file.
> I have a pretty good list in that log file, and have gleaned the match
> criteria for those arrays.
>
> So, in short, 1) how do open a SPECIFIC file, 2) how do i sequentially
> READ that file, 3) how do i know when i get to the end of the file so
> that the procedure does not crash, but gracefully close?
Why not do a search on
Javascript file I/O
and see what pops up ?
Example:
http://www.html5rocks.com/en/tutorials/file/dndfiles/
Paul
[toc] | [prev] | [next] | [standalone]
| From | Robert Baer <robertbaer@localnet.com> |
|---|---|
| Date | 2016-07-05 21:11 -0800 |
| Message-ID | <kq0fz.80333$3C1.49667@fx42.iad> |
| In reply to | #9991 |
Paul wrote: > Robert Baer wrote: >> ..impossibly opaque. >> There is a document open function/process/command/method [do not give >> a snap about the incomprehensible terminologies - care only about WHAT >> I CAN DO with it]. >> Almost zero info as to what eXactly (yes, X-rated) can be opened; fur >> [i am a baer, after all] eggzample, i would like to open a file to >> READ it. >> Ideally a function, READ file line by line in a little test loop. >> If line starts "Subject:" (no quotes), i know following info is an >> e-mail subject and i want to use the subject string to be compared >> with var Subj[] and a count that started at zero is incremented if a >> match. >> Next line starts "From:" (no quotes), has optional name _usually_ in >> quotes and to be compared with var SendName[] where count is >> incremented on a match; mail URL to be compared with var Address[] >> where count is incremented on a match. >> All following lines to be compared with var EBody[] where count is >> incremented on each match (if only one match allowed, that is acceptable) >> Function to be used on incoming e-mail file. >> I use count to issue various levels of warnings, as well as APPEND the >> Subject, From, and Date lines to a log file. >> I have a pretty good list in that log file, and have gleaned the match >> criteria for those arrays. >> >> So, in short, 1) how do open a SPECIFIC file, 2) how do i sequentially >> READ that file, 3) how do i know when i get to the end of the file so >> that the procedure does not crash, but gracefully close? > > Why not do a search on > > Javascript file I/O > > and see what pops up ? > > Example: > > http://www.html5rocks.com/en/tutorials/file/dndfiles/ > > Paul I did find other references similar to what you refer to. Note that second black block of code and the "browse" box; it talks about UPLOAD! And the files must be local, on the computer. Not useful to read an e-mail in the server. I see, in the middle, the following never seen before: FileReader.readAsText(Blob|File, opt_encoding) - The result property will contain the file/blob's data as a text string. By default the string is decoded as 'UTF-8'. Use the optional encoding parameter can specify a different format. FileReader.readAsDataURL(Blob|File) - The result property will contain the file/blob's data encoded as a data URL. BUT click on data URL and you see a wiki on URI, _local_ files. That makes me think that _ONLY_ local stuff can be handled. Another objection i have is the talk of an _upload_ WRT the read (of the local file) and i see nothing that specifies the remote file URL. If that code READS the (local) file, then WTH is being "uploaded" and more eXplicitly, _where_?? The "example" that asks for a directory of images will NOT accept a directory AKA folder. The ONLY thing it accepts is location of ONE image file. By this time i am about 2/3 thru the document and finding nothing i can use to implement my original idea. I gave up and see from that reference, "Reading files in JavaScript" that my decision was correct. Thanks for the reference; it is now in bookmarks. So, i copied about 70 e-mails from the server to a large text file, by manually reading each one and used copy/paste to a growing text file. That dew take a while..with NO WAY to do this via a program, what choice did i have? Parsed for sendname, address and subject to write to file for spreadsheet. Sorted and tossed out duplicates. Visual Basic to write javascript arrays for a fancy test script, including part of tat script. The "E_Body" array for testing was constructed via wetware and has 17 crafted phrases for that test script. Now it is ALL local,no file fiddling; bypassing external files (those e-mails on the server), even bypassing that local long file of e-mails. ***** Javascript is so...opaque. "document write" to where? Sequential, new? append? random? ISAM? "FileList - an array-like sequence of File objects"? what is a file "object"? can i "see" it? print it? access it? etc? Lettuce get obscenely arcane: "this" and "that"; completely and totally off the wall, at least 2-3 orders of magnitude worse than "document write". At least i can use "document write" to the screen for debug purposes.. Will stick to symple stuff.. Thanks.
[toc] | [prev] | [standalone]
Back to top | Article view | alt.computer
csiph-web