Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Experiments must be reproducible; they should all fail in the same way.


devel / comp.lang.clipper.visual-objects / Re: CSV, with Header,, easy way to rename headers,

SubjectAuthor
* CSV, with Header,, easy way to rename headers,Phil McGuinness
`* Re: CSV, with Header,, easy way to rename headers,Karl Faller
 `- Re: CSV, with Header,, easy way to rename headers,Phil McGuinness

1
CSV, with Header,, easy way to rename headers,

<b5862a5c-75ac-4e11-9acd-c24768c4ca22n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=806&group=comp.lang.clipper.visual-objects#806

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:620a:5fc:: with SMTP id z28mr41776307qkg.378.1620972066141; Thu, 13 May 2021 23:01:06 -0700 (PDT)
X-Received: by 2002:a0c:ea86:: with SMTP id d6mr44427042qvp.5.1620972065917; Thu, 13 May 2021 23:01:05 -0700 (PDT)
Path: i2pn2.org!rocksolid2!news.neodome.net!feeder5.feed.usenet.farm!feeder1.feed.usenet.farm!feed.usenet.farm!tr2.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Thu, 13 May 2021 23:01:05 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=220.233.174.33; posting-account=DLsZHwoAAADZjAB6-BmLUbnomrA9rubZ
NNTP-Posting-Host: 220.233.174.33
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b5862a5c-75ac-4e11-9acd-c24768c4ca22n@googlegroups.com>
Subject: CSV, with Header,, easy way to rename headers,
From: sherlocksoftware@gmail.com (Phil McGuinness)
Injection-Date: Fri, 14 May 2021 06:01:06 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 8
 by: Phil McGuinness - Fri, 14 May 2021 06:01 UTC

Quick, easy way to rename Headers of columns as they have spaces and mixed case and I want to import to PostGRES..

Have to manually fix... easy first time but need to do it on same export from other clients data.

Thanks in advance

I was thinking maybe "Excel.application" load and some function that did this..

Any ideas welcome

Re: CSV, with Header,, easy way to rename headers,

<nkpt9ghjbq00kgdb3da4ei2cl7brm0n64c@4ax.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=807&group=comp.lang.clipper.visual-objects#807

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: mail_withoutthat_@_drei-f_andthat_.de (Karl Faller)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: CSV, with Header,, easy way to rename headers,
Date: Fri, 14 May 2021 23:15:38 +0200
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <nkpt9ghjbq00kgdb3da4ei2cl7brm0n64c@4ax.com>
References: <b5862a5c-75ac-4e11-9acd-c24768c4ca22n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="89ad1efd50fc09dbfcf735a3a8b97f0d";
logging-data="9529"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ROtj/2Hop+HMn36EmXdeq"
User-Agent: ForteAgent/7.20.32.1218
Cancel-Lock: sha1:dLxjF1AL5fE+pUvoQVNWsfTJGbg=
 by: Karl Faller - Fri, 14 May 2021 21:15 UTC

Phil,
something along....

LOCAL cHeaderLine, cNewLine AS STRING
....
cHeaderLine :=FReadLine(ptrHandle, cFilename)
cNewLine := StrTran(cHeaderLine, " ", "")
FWrite(Upper(cNewLine)
FClose()

?

But that might cause problems, as your line will shrink, so i'd rather
replace the blanks with underscores...

On Thu, 13 May 2021 23:01:05 -0700 (PDT), Phil McGuinness wrote:

>Quick, easy way to rename Headers of columns as they have spaces and mixed case and I want to import to PostGRES..
>
>Have to manually fix... easy first time but need to do it on same export from other clients data.
>
>Thanks in advance
>
>I was thinking maybe "Excel.application" load and some function that did this..
>
>Any ideas welcome
Regards

Karl

Re: CSV, with Header,, easy way to rename headers,

<8da8547f-2d55-4000-acb2-af6190d9e3d9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=808&group=comp.lang.clipper.visual-objects#808

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:620a:16ad:: with SMTP id s13mr49799186qkj.453.1621146280115;
Sat, 15 May 2021 23:24:40 -0700 (PDT)
X-Received: by 2002:ac8:6f1a:: with SMTP id g26mr43323599qtv.270.1621146279981;
Sat, 15 May 2021 23:24:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Sat, 15 May 2021 23:24:39 -0700 (PDT)
In-Reply-To: <nkpt9ghjbq00kgdb3da4ei2cl7brm0n64c@4ax.com>
Injection-Info: google-groups.googlegroups.com; posting-host=220.233.162.254; posting-account=DLsZHwoAAADZjAB6-BmLUbnomrA9rubZ
NNTP-Posting-Host: 220.233.162.254
References: <b5862a5c-75ac-4e11-9acd-c24768c4ca22n@googlegroups.com> <nkpt9ghjbq00kgdb3da4ei2cl7brm0n64c@4ax.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8da8547f-2d55-4000-acb2-af6190d9e3d9n@googlegroups.com>
Subject: Re: CSV, with Header,, easy way to rename headers,
From: sherlocksoftware@gmail.com (Phil McGuinness)
Injection-Date: Sun, 16 May 2021 06:24:40 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Phil McGuinness - Sun, 16 May 2021 06:24 UTC

Karl

cCSVContent := MemoRead(GetDefault() +"TheDataAs.csv")
//
aCSVdata := Conv2Array( cCSVContent, CRLF )
aHeaders := Conv2Array( aCSVdata[1], [,] ) // The header
//
FOR xx := 1 TO ALen(aHeaders)
aHeaders[xx] := AllTrim(Lower(aHeaders[xx]))
aHeaders[xx] := StrTran(aHeaders[xx], _CHR(32))
cNewCSVHeader += aHeaders[xx] + [,]
NEXT
//
cNewCSVHeader := substr(cNewCSVHeader,1, slen(cNewCSVHeader)-1)
//
aCSVdata[1] := cNewCSVHeader+ CRLF
//
FOR xx := 1 TO ALen(aCSVdata)
cCSVFixed += aCSVdata[xx]+CRLF
NEXT
//

MemoWrit( GetDefault() +"TheDataFixed.csv", cCSVFixed )

Phil
--
> Phil,
> something along....
>
> LOCAL cHeaderLine, cNewLine AS STRING
> ...
> cHeaderLine :=FReadLine(ptrHandle, cFilename)
> cNewLine := StrTran(cHeaderLine, " ", "")
> FWrite(Upper(cNewLine)
> FClose()
>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor