Re: How to detect EOL character in text file (James Crate)

2017-05-17 Thread Jim Medlen via 4D_Tech
<>vCR:=Char(13) <>vLF:=Char(10) <>vCRLF:=Char(13)+Char(10) vText:=Replace string(vText;<>vCRLF;<>vCR) vText:=Replace string(vText;<>vLF;<>vCR) When parsing text I replace Carriage Return + Line Feed with Carriage Return Then replace Line Feed with carriage return. Then the Line endings are a

Re: Importing Data from a SQL-database (Firebird} [ was: How to detect EOL character in text file]

2017-05-16 Thread Charles Miller via 4D_Tech
On Tue, May 16, 2017 at 6:26 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > I think SQL EXECUTE SCRIPT is more suited for managing long SQL statements, > rather than creating a method with Begin SQL~End SQL > Just remember that all linked arrays must be process arrays Regards C

Re: Importing Data from a SQL-database (Firebird} [ was: How to detect EOL character in text file]

2017-05-16 Thread Keisuke Miyako via 4D_Tech
I think SQL EXECUTE SCRIPT is more suited for managing long SQL statements, rather than creating a method with Begin SQL~End SQL http://doc.4d.com/4Dv15/4D/15/SQL-EXECUTE-SCRIPT.301-2007434.en.html ** 4D Internet Users Group (

Re: Importing Data from a SQL-database (Firebird} [ was: How to detect EOL character in text file]

2017-05-16 Thread Keisuke Miyako via 4D_Tech
This message contains a digitally signed email which can be read by opening the attachment. ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://

Re: Importing Data from a SQL-database (Firebird} [ was: How to detect EOL character in text file]

2017-05-16 Thread Charles Miller via 4D_Tech
On Tue, May 16, 2017 at 10:02 AM, Jörg Knebel via 4D_Tech < 4d_tech@lists.4d.com> wrote: > > Due to the 32k-restriction it’ll take a while to get the still dirty data > finally into 4D. > I got 154,646 INSERT INTO-lines in a 62.8MB file. > > Bottom Line: Forget EOL if the char/string exist in the

Importing Data from a SQL-database (Firebird} [ was: How to detect EOL character in text file]

2017-05-16 Thread Jörg Knebel via 4D_Tech
G’day guys, I stopped counting how often I spit the dummy over the last days - it is just inhuman. The initial situation: A SQL-database with 70 tables (most of them empty) with sequentiell “relations” only used/written on Windows, wehre columns/fields contain all sorts of alien gremlins one

Re: How to detect EOL character in text file

2017-05-15 Thread Alan Chan via 4D_Tech
Replace String($text;lf;cr) -> all lf becomes cr including crlf becoming crcr Replace string($text;crlf;cr) -> none would be found That's why you need to run Replace String($text;crlf;cr) first. Alan Chan 4D iNug Technical <4d_tech@lists.4d.com> writes: >That should have read replace string of c

Re: How to detect EOL character in text file

2017-05-14 Thread Peter Mew via 4D_Tech
That should have read replace string of course if you change all the possible EOL characters to CR, then position will find all the CRs or have I missed something? pm On Sat, May 13, 2017 at 8:30 PM, James Crate via 4D_Tech < 4d_tech@lists.4d.com> wrote: > On May 13, 2017, at 8:53 AM, Peter Mew v

Re: How to detect EOL character in text file

2017-05-13 Thread James Crate via 4D_Tech
On May 13, 2017, at 8:53 AM, Peter Mew via 4D_Tech <4d_tech@lists.4d.com> wrote: > > Replace text($text;lf;cr) > Replace text($text;crlf;cr) > Position($text;cr) > -pm This won’t detect the line endings, which is what was asked, it will change them to CR. However, to properly normalize line endi

Re: How to detect EOL character in text file

2017-05-13 Thread Arnaud de Montard via 4D_Tech
> Le 13 mai 2017 à 14:04, David Adams via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > > On Sat, May 13, 2017 at 9:47 PM, Keisuke Miyako via 4D_Tech < > 4d_tech@lists.4d.com> wrote: > >> if you are on v14 or later, >> "Document to text" will normalise the end-of-line to whichever one you >> pre

Re: How to detect EOL character in text file

2017-05-13 Thread Arnaud de Montard via 4D_Tech
> Le 13 mai 2017 à 16:01, Arnaud de Montard via 4D_Tech <4d_tech@lists.4d.com> > a écrit : > [...] Previous code modified to evaluate if time taken to add more and more memory is linear. It seems not, each step "costs" a little more than the previous one (macOS). +++ C_BLOB($_x) $Mbyte_l:=1

​Re: How to detect EOL character in text file

2017-05-13 Thread steve simpson via 4D_Tech
On Sat, May 13, 2017 at 9:04 AM, ​ ​ Peter Mew wrote: > > > Replace text($text;lf;cr) > Replace text($text;crlf;cr) > Position($text;cr) > ​+1. I find this the fastest and simplest method of handling high volumes of incoming "unknown" or "known to be dirty" or "suspect" text. (And not just to fin

Re: How to detect EOL character in text file

2017-05-13 Thread Arnaud de Montard via 4D_Tech
> Le 13 mai 2017 à 15:04, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> a > écrit : > >> On 13 May 2017, at 22:58 AEST, Jörg Knebel via 4D_Tech >> <4d_tech@lists.4d.com> wrote: >> if the content bigger than 1GB? I don’t think TEXT could handle it. > > 4D v16 64bit can do big things with texts

Re: How to detect EOL character in text file

2017-05-13 Thread Jörg Knebel via 4D_Tech
> On 13 May 2017, at 22:58 AEST, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > if the content bigger than 1GB? I don’t think TEXT could handle it. 4D v16 64bit can do big things with texts too, can it not? What’s the size limit for TEXT (var/filed) in v16-64???

Re: How to detect EOL character in text file

2017-05-13 Thread Jörg Knebel via 4D_Tech
> On 13 May 2017, at 21:47 AEST, Keisuke Miyako via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > if you are on v14 or later, I’m on v16 > "Document to text" will normalise the end-of-line to whichever one you prefer. > > http://doc.4d.com/4Dv15/4D/15.4/Document-to-text.301-3274243.en.html >

Re: How to detect EOL character in text file

2017-05-13 Thread Peter Mew via 4D_Tech
Replace text($text;lf;cr) Replace text($text;crlf;cr) Position($text;cr) -pm Sent from my iPad > On 13 May 2017, at 09:16, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > G’day Guys, > > I’m not sure if this was already a topic in the past, at least I couldn’t > find anything in

Re: How to detect EOL character in text file

2017-05-13 Thread David Adams via 4D_Tech
On Sat, May 13, 2017 at 9:47 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > if you are on v14 or later, > "Document to text" will normalise the end-of-line to whichever one you > prefer. > > What a great feature! Thanks for pointing it out...I'd

Re: How to detect EOL character in text file

2017-05-13 Thread Keisuke Miyako via 4D_Tech
if you are on v14 or later, "Document to text" will normalise the end-of-line to whichever one you prefer. http://doc.4d.com/4Dv15/4D/15.4/Document-to-text.301-3274243.en.html it's better than using regex not knowing what the end-of-line is in the loaded text. 2017/05/13 17:16、Jörg Knebel via 4

Re: How to detect EOL character in text file

2017-05-13 Thread David Adams via 4D_Tech
On Sat, May 13, 2017 at 6:40 PM, Wayne Stewart via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Jörg, > > I'd just look and see. > > Grab a bunch of text say less than 1k > > Then use position (with the *) and see if you can find crlf, not there Look > for cr or LF then. > i like that idea. I was thi

Re: How to detect EOL character in text file

2017-05-13 Thread Wayne Stewart via 4D_Tech
Jörg, I'd just look and see. Grab a bunch of text say less than 1k Then use position (with the *) and see if you can find crlf, not there Look for cr or LF then. Wayne PS. Are you coming to Sydney world tour? On Sat, 13 May 2017 at 18:16, Jörg Knebel via 4D_Tech <4d_tech@lists.4d.com> wrote:

How to detect EOL character in text file

2017-05-13 Thread Jörg Knebel via 4D_Tech
G’day Guys, I’m not sure if this was already a topic in the past, at least I couldn’t find anything in my 174-month-Nug-Postings-archive. BBEdit knows 3 EOL-“Markers” Mac(legacy) CR UnixLF Windows CRLF Having a bit of a singularity in my human C