Author Topic: Double Quotes automate in text file  (Read 821 times)

Tags:
  • All members
  • Posts: 829
Double Quotes automate in text file
« on: 08 Mar 2022, 09:23 »
Hi,
Does anyone have any ideas on how to automatically apply double quotes in a Notepad text file ?
Quite a tedious process doing it manually for sometimes dozens of bets.
Cheers 
My grandma taught me not to run downstairs and never back odds on.

  • Moderator
  • Posts: 3605
*
Re: Double Quotes automate in text file
« Reply #1 on: 08 Mar 2022, 18:27 »
Hi
Just tried a few things, came up with a several stage process:

prepare an Excel sheet:

A                      B                          C
selection name   imported_1 value   imported_2 value

highlight column A cells. Right-click and choose Format Cells
On the Number tab choose Custom  
In the Type: field put \"@\" and click OK
Save the file as Tab delimited text

Open the saved text file in Notepad. It should be tab delimited.
the selection names are enclosed in """Three Quotes"""
Edit, Replace, Find what: """, Replace with "
Click Replace All
Save text file

It gets easier after you've done it a few times ;)  
Please read the following disclaimer with regards to the information you may request and obtain on our forum. This specifically concerns trigger files and various instructions as to how to implement a strategy.

  • All members
  • Posts: 829
Re: Double Quotes automate in text file
« Reply #2 on: 09 Mar 2022, 16:56 »
Hi Mark,

Thanks for that. It worked a bit better for me. Perfect in fact, as under:

"Mcqueen"
"bill bell"

Cheers

Ian
My grandma taught me not to run downstairs and never back odds on.

  • All members
  • Posts: 154
  • Gender: Male
Re: Double Quotes automate in text file
« Reply #3 on: 10 Apr 2022, 18:45 »
Hi,

With a tiny bit of effort, the below will speed things up for you.  I use this every day, pretty much, to create a selections file for my triggers.

With reference to the attachments.
One is a screen shot of what the spreadsheet looks like should you wish to recreate it.
I have also attached a copy of the spreadsheet I created for you to use directly.

The formulae assume the list of names are in Col C, starting at C3

Cell H3 formula =CONCAT("~",C3,"~")
This puts ~ either side of the name

Cell G3 formula =REPLACE(H3,1,1,"""")
This replaces the first ~ with double quotes

Cell F3 formula =REPLACE(G3,FIND("~",G3),1,"""")
This replaces the second ~ with double quotes

Cell E3 formula =IFERROR(REPLACE(F3,FIND("'",F3),1,""),F3)
This removes any single quotes as sometimes found in horse names
e.g. King's Advice becomes Kings Advice
Why? Because MFP won't accept ' in a text file selection's name!

Select and drag the formulae from row 3 down as needed.
All the names now in column E (highlighted in grey) can be selected in en-masse and pasted into a text file.

Hope that helps,

regards

Wez

  • All members
  • Posts: 829
Re: Double Quotes automate in text file
« Reply #4 on: 10 Apr 2022, 19:48 »
Hi Wez,

Thanks for your detailed solutions. 
I have used the below formula for a few years to strip off those nasty hieroglyphics and make the names
compatible with Betfair. It works a treat and never had a single problem in 5+years.
  PROPER(SUBSTITUTE(SUBSTITUTE(LEFT(EP14,IFERROR(FIND("(",EP14)-1,LEN(EP14))),"`",""),"'","")))

With regards to the double quotes, the solution Mark provided \"@\" has worked well. It can be stored in the
formatting under number/custom. However if there are any updates the \"@\" gets overwritten so it pays
to keep a copy handy on the spreadsheet. It only is used if the data range loses its formatting which is rare.

Cheers and Good Luck

Ian
My grandma taught me not to run downstairs and never back odds on.

  • All members
  • Posts: 154
  • Gender: Male
Re: Double Quotes automate in text file
« Reply #5 on: 10 Apr 2022, 21:30 »
Hi Ian,

thanks for that.

It has led me to simplify mine even further as a result!

Assuming the name is in cell S4

=CONCAT(CONCAT("""",SUBSTITUTE(SUBSTITUTE(LEFT(S4,LEN(S4)),"`",""),"'","")),"""")

this now yields the name in double quotes and takes care of any single quotes.

Many thanks for the info/idea,

regards

Wez

 

Please note, BetFair is seems to be currently OFFLINE