Re: GREP help: dig into the report of the cash register

2018-12-04 Thread Christopher Stone
On 12/04/2018, at 04:19, m.osti mailto:mk0...@gmail.com>> 
wrote:
> Hello, every day when I have to close up my shop I get this report from the 
> cash register. I have the obligation to transmit some sales data through a 
> web page, and I have to insert one receipt at a time, sigh.
> Only sales that have the "C.F." are valid.


Hey M.,

This is a bit of a sticky problem, so I'm not surprised you had problems when 
relying on grep alone.

Run this AppleScript from the Applescript Editor against your register tape in 
BBEdit.

I believe I've extracted the relevant data from the tape.  If so then we need 
another pass to get just the values you want.

>From there it shouldn't be hard to pop those values into Keyboard Maestro 
>variables for insertion into your web page.

--
Best Regards,
Chris


# Auth: Christopher Stone
# dCre: 2018/12/04 16:04
# dMod: 2018/12/04 16:04 
# Appl: BBEdit
# Task: Extract Cash Register Info.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @Extract, @Cash, @Register, @Info, 
@BBEdit-Talk


set AppleScript's text item delimiters to ""

tell application "BBEdit"
tell front text window's text

replace "^\\h+EURO\\h*\\n" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "^\\h+$" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "\\n{2,}" using "\\n" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "^N\\.SCONTR\\.FISCALE.*" using "&\\n" options {search 
mode:grep, case sensitive:false, starting at top:true}
replace "\\A\\s+|\\s+\\Z" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}

set docText to its text
set AppleScript's text item delimiters to linefeed & linefeed
set recordList to text items of docText

repeat with i in recordList
if contents of i does not contain "C.F." then
set contents of i to missing value
end if
end repeat

set recordList to (text of recordList) as text
set its text to recordList

replace "^(?>(?:(?!(?:t_fiscale|C\\.F\\.|\\d{2}-\\d{2}-\\d{4}|TOTALE 
EURO)).)*)$\\R?" using "" options {search mode:grep, case sensitive:false, 
starting at top:true}
replace "^t_fiscale" using "\\n&" options {search mode:grep, case 
sensitive:false, starting at top:true}
replace "\\A\\s+|\\s+\\Z" using "" options {search mode:grep, case 
sensitive:false, starting at top:true}

select insertion point before it

end tell
end tell



-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: [ANN] BBEdit Merchandise

2018-12-04 Thread Gerald Davenport
this is awesome!!!  thank you!!!

On Tue, Dec 4, 2018 at 9:01 AM Rich Siegel  wrote:

> Good afternoon,
>
> We're pleased to announce the opening of our merchandise store!
>
> The merch store features an array of wearable items, including a
> limited-edition 25th anniversary BBEdit T-shirt, a re-issue of
> the popular classic "It Doesn't Suck" shirt, fleece and hoodie
> jackets, workout pants, and an enameled pin of the BBEdit icon.
>
> Go shopping: .
>
> Enjoy,
>
> R.
> --
> Rich Siegel Bare Bones Software, Inc.
>   
>
> Someday I'll look back on all this and laugh... until they
> sedate me.
>
> --
> This is the BBEdit Talk public discussion group. If you have a
> feature request or need technical support, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
> ---
> You received this message because you are subscribed to the Google Groups
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bbedit+unsubscr...@googlegroups.com.
> To post to this group, send email to bbedit@googlegroups.com.
> Visit this group at https://groups.google.com/group/bbedit.
>

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: [ANN] BBEdit Merchandise

2018-12-04 Thread Scott Lopez
Please don’t become Evernote!

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: [ANN] BBEdit Merchandise

2018-12-04 Thread Rich Siegel
On 12/4/18 at 12:13 PM, scot...@gmail.com (Scott Lopez) wrote:

> Please don’t become Evernote!

OK.

R.
-- 
Rich Siegel Bare Bones Software, Inc.
  

Someday I'll look back on all this and laugh... until they sedate me.

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: GREP help: dig into the report of the cash register

2018-12-04 Thread David G Wagner
You state what you need is in red, but you do not show any date in red. Please 
clarify...

thank you...

Wags ;)
WagsWorld
Hebrews 4:15
Ph(primary) : 408-914-1341
Ph(secondary): 408-761-7391
On Dec 4, 2018, 05:14 -0800, m.osti , wrote:
> Hello, every day when I have to close up my shop I get this report from the 
> cash register. I have the obligation to transmit some sales data through a 
> web page, and I have to insert one receipt at a time, sigh.
> Only sales that have the "C.F." are valid.
> In this case I need it in the order:
> the date
> the receipt number
> the total euro
> the alphanumeric part after C.F. for example ABCDEF12G34H567I which is of 16 
> characters always in this order 6 alphabetic characters, 2 numbers, 1 
> character, 2 numbers, 1 character, 3 numbers, 1 character.
>
> Now I copy them by hand and then I use a macro that I created in 
> KeyboardMaestro. Since there is a lot of data that I don't need, to speed up 
> I tried to extract only the necessary values through a GREP search, but I 
> failed, failed, failed and after many attempts I decided to ask.
> If it were possible I would also like the date separator to be / instead of -
>
> I'm going to put on the cash register closure below: the values I need are in 
> red.
> Thank you and sorry for my english.
> ciao from italy
>
> -m
>
> ---
>
> t_fiscale 20170422 0846 1
>                   EURO
> LENTI OFT         110,00
> MONTAGGIO LENTI    20,00
> TOTALE EURO       130,00
> CONTANTE          130,00
> C.F.   ABCDEF12G34H567I
>
> CASSA:                01
> 22-04-2017         08:46
> N.SCONTR.FISCALE       1
> t_fiscale 20170422 0936 2
>                   EURO
> LENTI CONTATTO    100,00
> TOTALE EURO       100,00
> CONTANTE          100,00
> C.F.   ABCDEF12G34H567I
>
> CASSA:                01
> 22-04-2017         09:36
> N.SCONTR.FISCALE       2
> t_fiscale 20170422 1037 3
>                   EURO
> MONTATURE OFT     120,00
> LENTI OFT         120,00
> MONTAGGIO LENTI    20,00
> TOTALE EURO       260,00
> CONTANTE          260,00
> C.F.   LMNOPQ89R01S234T
>
> CASSA:                01
> 22-04-2017         10:37
> N.SCONTR.FISCALE       3
> t_fiscale 20170422 1055 4
>                   EURO
> IVA 22              8,00
> TOTALE EURO         8,00
> CONTANTE            8,00
>
> CASSA:                01
> 22-04-2017         10:55
> N.SCONTR.FISCALE       4
> t_fiscale 20170422 1826 5
>                   EURO
> SOLUZIONI LAC      23,00
> TOTALE EURO        23,00
> CONTANTE           23,00
> C.F.   LMNOPQ89R01S234T
>
> CASSA:                01
> 22-04-2017         18:26
> N.SCONTR.FISCALE       5
> t_non fiscale 20170422 1843 1
>       NON FISCALE
>     RAPPORTO REPARTI "Z"
>          PERIODICO 1
> (++ BELOW UNNECESSARY DATA ++)
> DATA ULTIMO AZZERAMENTO
>                    21-04-2017
>
> CASSA:                01
> 22-04-2017         18:43
> N.SCONTR.NON FISC      1
>       NON FISCALE
> t_fiscale 20170422 1843 6
>       RAPPORTO *Z*
>     CHIUSURA FISCALE
>       DATI IN EURO
>
> 
>      CORRISPETTIVI
>        SCONTRINI
> 
> CORRISP. GIORNALIERI
>                 1 234,00
> PROGR. CORRISPETTIVI
>               123 456,78
> NOTE DI CREDITO GIORN.
>                     0,00
>
> 
>      CORRISPETTIVI
>     DOCUMENTI CL.II
> 
> CORRISP. GIORNALIERI
>                     0,00
> *FATTURE            0,00
> *RICEVUTE           0,00
> NOTE DI CREDITO GIORN.
>                     0,00
>
> 
>        DETTAGLIO
>        OPERAZIONI
> 
> SCONTI              0,00
>       N.    0
> MAGGIORAZ.          0,00
>       N.    0
> BONIFICI            0,00
>       N.    0
> RETTIFICHE          0,00
>       N.    0
> CORRISP. NON RISCOSSI
> *SCONTRINI          0,00
> *RICEVUTE           0,00
> CORRISP. RISCOSSI
> *SCONTRINI      1 234,00
> *FATTURE            0,00
> *RICEVUTE           0,00
>
> 
>        DOCUMENTI
>       GIORNALIERI
> 
> N.SCONTR.FISCALI       6
> *N.SCONTR./NOTE CRED.  0
> N.SCONTR.N FISCALI     1
> *N.RAPP.LETTURE DGFE   0
>
> N.DOCUMENTI CL.II      0
> *N.FATTURE             0
> *N.FATTURE/NOTE CRED.  0
> *N.RICEVUTE            0
>
> 
>      DATI GENERALI
> 
> N.LETT.MEM.FISCALE     0
>
> PROGR. AZZERAMENTI   960
> NUM. RIPRISTINI        0
>
> 
> DISPOS.GIORN.ELETTRONICO
>       N.2 DEL 02-05-2014
>        MATR. 05 30005163
>
> CASSA:                01
> 22-04-2017         18:43
> N.SCONTR.FISCALE       6
>
> --
> This is the BBEdit Talk public discussion group. If you have a
> feature request or need technical support, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 
> ---
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this 

[ANN] BBEdit Merchandise

2018-12-04 Thread Rich Siegel

Good afternoon,

We're pleased to announce the opening of our merchandise store!

The merch store features an array of wearable items, including a 
limited-edition 25th anniversary BBEdit T-shirt, a re-issue of 
the popular classic "It Doesn't Suck" shirt, fleece and hoodie 
jackets, workout pants, and an enameled pin of the BBEdit icon.


Go shopping: .

Enjoy,

R.
--
Rich Siegel Bare Bones Software, Inc.
  

Someday I'll look back on all this and laugh... until they 
sedate me.


--
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Suffix text with ";" in multiple files

2018-12-04 Thread Rich Siegel

On 12/3/18 at 10:47 PM, rh...@jumbosoft.eu (Ronald Hofmann) wrote:

I have a folder with 2500 text files and all lines end with ";" 
except the last line like this


Mendoza,-32.890845,-68.827171,973'047,ARG;
Rosario,-32.946818,-60.639317,1'218'497,ARG;
Cordoba,-31.413496,-64.181052,1'441'007,ARG

Instead of opening every file and adding a ";" I'm looking for 
an automation to do this for me.


In Grep, "\Z" matches the end of file. So you could try doing a 
multi-file Replace all with Grep turned on, searching for "\Z" 
and replacing with ";".


R.
--
Rich Siegel Bare Bones Software, Inc.
  

Someday I'll look back on all this and laugh... until they 
sedate me.


--
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email

"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Re: Suffix text with ";" in multiple files

2018-12-04 Thread Andrew Brown
Add a ; at the end of every line then change ;; to ;

AB

> On 4 Dec 2018, at 04:47, Ronald Hofmann  wrote:
> 
> Hi all,
> 
> I have a folder with 2500 text files and all lines end with ";" except the 
> last line like this
> 
> Mendoza,-32.890845,-68.827171,973'047,ARG;
> Rosario,-32.946818,-60.639317,1'218'497,ARG;
> Cordoba,-31.413496,-64.181052,1'441'007,ARG
> 
> Instead of opening every file and adding a ";" I'm looking for an automation 
> to do this for me.
> May be BBEdit can do it? I only found "suffix lines".
> 
> Any clues?
> 
> Greetings from Germany, Ronald 
> 
> -- 
> This is the BBEdit Talk public discussion group. If you have a 
> feature request or need technical support, please email
> "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter:  >
> --- 
> You received this message because you are subscribed to the Google Groups 
> "BBEdit Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to bbedit+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to bbedit@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/bbedit 
> .

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


Suffix text with ";" in multiple files

2018-12-04 Thread Ronald Hofmann
Hi all,

I have a folder with 2500 text files and all lines end with ";" except the 
last line like this

Mendoza,-32.890845,-68.827171,973'047,ARG;
Rosario,-32.946818,-60.639317,1'218'497,ARG;
Cordoba,-31.413496,-64.181052,1'441'007,ARG

Instead of opening every file and adding a ";" I'm looking for an 
automation to do this for me.
May be BBEdit can do it? I only found "suffix lines".

Any clues?

Greetings from Germany, Ronald 

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.


GREP help: dig into the report of the cash register

2018-12-04 Thread m.osti
Hello, every day when I have to close up my shop I get this report from the 
cash register. I have the obligation to transmit some sales data through a 
web page, and I have to insert one receipt at a time, sigh.
Only sales that have the "C.F." are valid.
In this case I need it in the order:
the date
the receipt number
the total euro
the alphanumeric part after C.F. for example ABCDEF12G34H567I which is of 
16 characters always in this order 6 alphabetic characters, 2 numbers, 1 
character, 2 numbers, 1 character, 3 numbers, 1 character.

Now I copy them by hand and then I use a macro that I created in 
KeyboardMaestro. Since there is a lot of data that I don't need, to speed 
up I tried to extract only the necessary values through a GREP search, but 
I failed, failed, failed and after many attempts I decided to ask.
If it were possible I would also like the date separator to be / instead of 
-

I'm going to put on the cash register closure below: the values I need are 
in red.
Thank you and sorry for my english.
ciao from italy

-m

---

t_fiscale 20170422 0846 *1*
  EURO  
LENTI OFT 110,00
MONTAGGIO LENTI20,00
TOTALE EURO   *130,00*
CONTANTE  130,00
C.F.   *ABCDEF12G34H567I* 

CASSA:01
*22-04-2017* 08:46
N.SCONTR.FISCALE   1
t_fiscale 20170422 0936 *2*
  EURO  
LENTI CONTATTO100,00
TOTALE EURO   *100,00*
CONTANTE  100,00
C.F.   *ABCDEF12G34H567I* 

CASSA:01
22-04-2017 09:36
N.SCONTR.FISCALE   2
t_fiscale 20170422 1037 *3*
  EURO  
MONTATURE OFT 120,00
LENTI OFT 120,00
MONTAGGIO LENTI20,00
TOTALE EURO   *260,00*
CONTANTE  260,00
C.F.   *LMNOPQ89R01S234T* 

CASSA:01
22-04-2017 10:37
N.SCONTR.FISCALE   3
t_fiscale 20170422 1055 4
  EURO  
IVA 22  8,00
TOTALE EURO 8,00
CONTANTE8,00

CASSA:01
22-04-2017 10:55
N.SCONTR.FISCALE   4
t_fiscale 20170422 1826 *5*
  EURO  
SOLUZIONI LAC  23,00
TOTALE EURO23,00
CONTANTE   *23,00*
C.F.   *LMNOPQ89R01S234T* 

CASSA:01
22-04-2017 18:26
N.SCONTR.FISCALE   5
t_non fiscale 20170422 1843 1
  NON FISCALE   
RAPPORTO REPARTI "Z" 
 PERIODICO 1 
*(++ BELOW UNNECESSARY DATA ++)*
DATA ULTIMO AZZERAMENTO  
   21-04-2017

CASSA:01
22-04-2017 18:43
N.SCONTR.NON FISC  1
  NON FISCALE   
t_fiscale 20170422 1843 6
  RAPPORTO *Z*  
CHIUSURA FISCALE
  DATI IN EURO  


 CORRISPETTIVI  
   SCONTRINI

CORRISP. GIORNALIERI
1 234,00
PROGR. CORRISPETTIVI
  123 456,78
NOTE DI CREDITO GIORN.  
0,00


 CORRISPETTIVI  
DOCUMENTI CL.II 

CORRISP. GIORNALIERI
0,00
*FATTURE0,00
*RICEVUTE   0,00
NOTE DI CREDITO GIORN.  
0,00


   DETTAGLIO
   OPERAZIONI   

SCONTI  0,00
  N.0   
MAGGIORAZ.  0,00
  N.0   
BONIFICI0,00
  N.0   
RETTIFICHE  0,00
  N.0   
CORRISP. NON RISCOSSI   
*SCONTRINI  0,00
*RICEVUTE   0,00
CORRISP. RISCOSSI   
*SCONTRINI  1 234,00
*FATTURE0,00
*RICEVUTE   0,00


   DOCUMENTI
  GIORNALIERI   

N.SCONTR.FISCALI   6
*N.SCONTR./NOTE CRED.  0
N.SCONTR.N FISCALI 1
*N.RAPP.LETTURE DGFE   0

N.DOCUMENTI CL.II  0
*N.FATTURE 0
*N.FATTURE/NOTE CRED.  0
*N.RICEVUTE0


 DATI GENERALI  

N.LETT.MEM.FISCALE 0

PROGR. AZZERAMENTI   960
NUM. RIPRISTINI0


DISPOS.GIORN.ELETTRONICO
  N.2 DEL 02-05-2014
   MATR. 05 30005163

CASSA:01
22-04-2017 18:43
N.SCONTR.FISCALE   6

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or need technical support, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To