| Newsgroups |
gmane.editors.sed.user |
| Message-ID |
<[email protected]> |
Thanks for doing the test again. Yes, 145 vs 1.2 seems to make more
sense, because the looping with the many sed invocations. The previous 1
vs .22 seemed too close. But you never know. The only way to know is to
do the test (and hope the test is set up correctly).
Thanks, Daniel
On 12/12/2015 11:43 AM, Thierry Blanc [sed-users] wrote:
> I just finished this parameter version
>
> BTW, speed test was faulty, the testfile had ^M instead of newline. the
> loop script takes about 145s vs. 1.2s
>
>
> #!/bin/bash
>
>
> INFILE=$1
> COL=$2
> let "MAXCOL = $COL + 1"
> MYCOL="col$COL"
>
> READ="$(seq -f "col%g" -s " " $MAXCOL)"
> WRITE="$(seq -f "\$col%g" -s "," $MAXCOL)"
>
>
> while IFS=',' read $READ
> do
> eval TARGET="\$$MYCOL"
>
> eval col$COL="\"$(echo "$TARGET" | sed -r 's/(.*)/\L\1/;
> s/\<(.)/\u\1/g' )\""
> eval echo $WRITE
>
> done < $INFILE >$3
>
------------------------------------
------------------------------------
--
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/sed-users/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/sed-users/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/