Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Text replacement question.

- - - - -

  • Please log in to reply
22 replies to this topic

#1
Justin90

Justin90

    Newbie

  • Member
  • 15 posts
  • Joined 14-November 11
  • OS:Windows 7 x64
  • Country: Country Flag
I have a question with replacing text in the Alleycode program.

Here are some of the lines I'm working with:
2524>Ranger 700 6x6 EFI Commercial
7890>Ranger 700 Crew
7891>Ranger 700 Crew LE Black Cherry
7892>Ranger 700 Crew LE Browning Hunter Edition
7893>Ranger 700 Crew LE Turbo Silver
2525>Ranger 700 HD

I'm looking for a way to replace the start of each line (e.g. 2524>, 7890>, 7891>) up to the > with blank space so I only end up with the model of these four wheelers (there's many more, that's why I'm trying to figure out an easy way to do this).

Is there a way to automatically do this by using a code in the replace feature, or another way I can do it?

I'm at work and could really use a quick response on this... I need to get these done ASAP.
Thanks.


How to remove advertisement from MSFN

#2
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,958 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

Do not make multiple topics for the same thing. :realmad:

What is Alleycode? Is it an online HTML editor?
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#3
Justin90

Justin90

    Newbie

  • Member
  • 15 posts
  • Joined 14-November 11
  • OS:Windows 7 x64
  • Country: Country Flag
yea its used for several things. you should check it out. but i just need to know if there's some code that i can use to make it faster.

#4
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,958 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

I have not used that program and don't intend on trying it. I do all my web work using SciTE and UltraEdit.

Did you try using their support option? I saw on their main site they had a link for it.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#5
Justin90

Justin90

    Newbie

  • Member
  • 15 posts
  • Joined 14-November 11
  • OS:Windows 7 x64
  • Country: Country Flag
Yes, I tried it and they said they don't know of a way to do it using the replace feature... do you know of another program that can do what I'm asking?

By the way Alleycode is pretty popular, I'm surprised you haven't heard of it.

#6
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,654 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Yes, I tried it and they said they don't know of a way to do it using the replace feature... do you know of another program that can do what I'm asking?

Are we talking of replacing some text in a .htm or .html file?

By the way Alleycode is pretty popular, I'm surprised you haven't heard of it.

Popular among WHOM? :unsure:

I mean like :whistle: :
  • Pogrammers
  • Web developers
  • Kids
  • Electricians and Plumbers
  • Other


jaclaz

Edited by jaclaz, 15 November 2011 - 02:02 PM.


#7
Justin90

Justin90

    Newbie

  • Member
  • 15 posts
  • Joined 14-November 11
  • OS:Windows 7 x64
  • Country: Country Flag

Yes, I tried it and they said they don't know of a way to do it using the replace feature... do you know of another program that can do what I'm asking?
Are we talking of replacing some text in a .htm or .html file?

The format doesn't really matter. If you know a code to replace a start of a line to a like symbol (> would be the symbol in this case) then give me the code and I can use it.

By the way Alleycode is pretty popular, I'm surprised you haven't heard of it.

Popular among WHOM? :unsure:

I mean like :whistle: :

  • Pogrammers
  • Web developers
  • Kids
  • Electricians and Plumbers
  • Other

Programmers, web developers. My boss uses alleycode every day and created a $7,000+ a day website with it.

Edited by Justin90, 15 November 2011 - 02:19 PM.


#8
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,654 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

The format doesn't really matter. If you know a code to replace a start of a line to a like symbol (> would be the symbol in this case) then give me the code and I can use it.

It does, rest assured, is the file a TEXT format or a binary one?


Programmers, web developers. My boss uses alleycode every day and created a $7,000+ a day website with it.

Well, the fact that your boss made a site with alleycode and that this particuar site makes a 7K bucks a day ( i.e. roughly 2.5 millions US$ per year) are two facts, but not necessarily in a cause-effect relationship.

It should mean that your boss is highly creative and knows very well how to build and promote sites, not necesarily that alleycode is popular among programmers (or at least let's say that I know very few programmers making 2.5 million bucks per year, so it is possible that alleycode is popular among only among this -I presume -restricted group of people, let's call them RICH programmers).
But a programmer would probably know how to replace a few characters in the beginning of each line in a file. :unsure:

jaclaz

#9
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,958 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator


The format doesn't really matter. If you know a code to replace a start of a line to a like symbol (> would be the symbol in this case) then give me the code and I can use it.

It does, rest assured, is the file a TEXT format or a binary one?


As noted, the format is extremely important, especially when dealing with a markup language that uses the same characters you want to replace. We could say a standard "search and destroy" formula such as this would seem ideal:

FIND "*>" REPLACE ""

However, you'd see that HTML uses > in it's markup tags, so using a replace like that would destroy the page. However, another option would be to programmatically do a find/replace where you can look for the specific things you want. If this data were kept in a database, a trim would work fine, but if it is in the text of HTML you'd need to specify something like:

FIND "xxxx>" WHERE (x = numerical value) with ""

Of course your standard find and replace isn't smart enough to do this, so a custom app or script would be required. Then again, the amount of time developing and testing said script until it is done may actually take longer than just changing all those values by hand.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#10
CoffeeFiend

CoffeeFiend

    Coffee Aficionado

  • Super Moderator
  • 5,399 posts
  • Joined 14-July 04
  • OS:Windows 7 x64
  • Country: Country Flag

Well, the fact that your boss made a site with alleycode and that this particuar site makes a 7K bucks a day ( i.e. roughly 2.5 millions US$ per year) are two facts, but not necessarily in a cause-effect relationship.

^^ What he said. You could make a multi-million dollar site using notepad or any old text editor. That means very little about the text editor, it's more about running a business than anything else. Also, I wouldn't call Alleycode "well known" at all, even in the web development world (and "not at all" as for "traditional" programmers). The big player is obviously Dreamweaver, followed by dozens of small yet somewhat popular apps, including many text editors (notepad++, notepad2, textmate, ultraedit, pspad, gedit, emacs, vim, nano, etc) and several HTML editors (Expression Web, FrontPage before that, Nvu, etc). I've never heard of Alleycode before, and I will be surprised if I ever hear about again.

But a programmer would probably know how to replace a few characters in the beginning of each line in a file. :unsure:

That kind of task (search and replace strings, with very simple text I/O) is well within reach of scripting newbies, let alone decent programmers. Either ways, it sounds like he can afford to hire someone to do it.
Coffee: \ˈkȯ-fē, ˈkä-\. noun. Heaven in a cup. Life's only treasure. The meaning of life. Kaffee ist wunderbar. C8H10N4O2 FTW.

#11
Justin90

Justin90

    Newbie

  • Member
  • 15 posts
  • Joined 14-November 11
  • OS:Windows 7 x64
  • Country: Country Flag
Ok if the format matters I guess...

Here's why I'm doing this, actually haven't had much time to work on it, only gotten a couple hundred done out of the thousands I have to get. I'm really busy most of the time lol.

______________________________
I'm taking models that look like this -

<option value="6199">Patriot 250</option>
<option value="6200">Patriot 250 MX</option>

I then use replace to remove <option value=", the extra ", and the </option>

Leaving me with:
6199>Patriot 250
6200>Patriot 250

These are models of four wheelers. I will be grabbing thousands of these to be plugging in to a model finder on my bosses websites. It will be entered in as HTML once I get them all done.

So all I need to do I guess is find some code to replace starting at the beginning of the line up to the >.
If using HTML to have the numbers replaced up to the > causes a problem, I can simply change that symbol to anything using the replace feature, so if you know of a code I can use, tell me to change > to whatever it needs to be to get it to work.

Thanks for trying to help and communicate so far guys.

And as for my boss being able to write the code, he's too busy for that, that's why I came to this forum seeking people who like to write code as projects and just mess with code in general to see if I could be helped to get this to go faster.
He's doing a complete overhaul on all of our websites at the moment and is working from home so everyone doesn't bother him about little stuff (this would be classified as more little stuff to him).

Edit: I'm not really sure about the format actually... when I'm done with these I'm saving them as CSV (comma separated values) sheets. I think he just has to go in to the master database and upload them. So no it doesn't really matter what format I change it in.
The object is just to end up with the model number and get it saved to a CSV sheet for uploading, how I get the numbers off doesn't matter at all.

Edited by Justin90, 16 November 2011 - 11:37 AM.


#12
IcemanND

IcemanND

    MSFN Junkie

  • Super Moderator
  • 3,266 posts
  • Joined 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
How about going about this in a totally different way? Looks like you are pulling this info from a web page. Copy everything from the <select to </select> an save it in a file. Import the file as XML using power shell and then read the attributes out to a new file.

So if you save something like the following as option.xml:
<Select name="vehicle">
  <option value="6199">Patriot 250</option>
  <option value="6200">Patriot 250 MX</option>
</select>

Then in powershell type the following commands, from the directory the option.xml file is in:
[xml]$option = Get-Content .\option.xml

To output to screen:
$option.select.option

To output to file:
$option.select.option | out-file .\options.txt

#13
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,654 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
It took all of 37 seconds to devise this mindboggingly complex :w00t: batch script (actually a one-liner :whistle: ):
@ECHO OFF&FOR /F "tokens=2 delims=^>" %%A IN (testmodel.csv) do echo %%A>>mymodels.csv

If you have "testmodel.csv" containing:

6199>Patriot 250
6200>Patriot 250 MX


You will get as result a mymodels.csv file containing:

Patriot 250
Patriot 250 MX


Consequently, since I normally invoice a mere 3,600 US$/hour, you owe me 37 US$. :angel

jaclaz

#14
IcemanND

IcemanND

    MSFN Junkie

  • Super Moderator
  • 3,266 posts
  • Joined 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Consequently, since I normally invoice a mere 3,600 US$/hour, you owe me 37 US$. :angel

jaclaz


Remind me not to have you fix one of my computers.

#15
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,654 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

Remind me not to have you fix one of my computers.

Well, I make SUBSTANTIAL rebates on my list prices for old-time friends like you ;) and BTW, the mentioned rate was the one reserved to RICH programmers/web developers only.
I calculate through a complex algorithm (which I won't fully disclose) that basically takes into account the inverse of the sum of the squares of the Alexa Ranking of the sites owned by the client. :whistle:

jaclaz

#16
Justin90

Justin90

    Newbie

  • Member
  • 15 posts
  • Joined 14-November 11
  • OS:Windows 7 x64
  • Country: Country Flag

It took all of 37 seconds to devise this mindboggingly complex :w00t: batch script (actually a one-liner :whistle: ):

@ECHO OFF&FOR /F "tokens=2 delims=^>" %%A IN (testmodel.csv) do echo %%A>>mymodels.csv


Where would I be using this code at jaclaz?
I don't really know where to use it like what program, what part of the program... I'm pretty new to this.
I appreciate your time even though you all are poking fun at me lol.

It's okay I'm a newbie I get it

Edit:

Removed image lol, don't want to keep that on here =o

I tried to save some of the models as testmodels.csv in a text document, and then tried to run the code in cmd prompt (im clueless, just guessing where to use it) and i got "##A was unexpected at this time."

Dang I felt so close to finding the answer, but no more responses...

Thanks for the help if I've exhausted your knowledge on the subject. I appreciate it.

Edited by Justin90, 17 November 2011 - 09:57 AM.


#17
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,654 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

I tried to save some of the models as testmodels.csv in a text document, and then tried to run the code in cmd prompt (im clueless, just guessing where to use it) and i got "##A was unexpected at this time."


Yes :), the snippet I posted should be copied and pasted in a .cmd file.
If you want to run it in a command line (from a command prompt in the same directory where testmodels.csv is) you need to use single percentage signs, as in the following:
Command line:
@ECHO OFF&FOR /F "tokens=2 delims=^>" %A IN (testmodel.csv) do echo %A>>mymodels.csv
Inside a .cmd file:
@ECHO OFF&FOR /F "tokens=2 delims=^>" %%A IN (testmodel.csv) do echo %%A>>mymodels.csv

Here's proof I wasn't lying by the way lol...

I don't get it :unsure:, noone said you were lying, I said that you mistakenly attributed the success of an enterprise to the tool (specifically Alleycode) it was supposedly used to build the site.
In any case what you posted is an UNreadable screenshot of heavens only know WHAT (beacuse it is unreadable).
IF I had doubted your word about your boss making around 2.5 Millions bucks a year, you would hae needed to send me an authenticated copy of his IRS tax form ;) to prove your statement.


jaclaz

#18
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,958 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

In any case what you posted is an UNreadable screenshot of heavens only know WHAT (beacuse it is unreadable).

jaclaz


At a thumbnail size in such low quality, its a wonder why editing out names was even necessary. Except that it can be seen it is MerchantPlus NaviGate. Unfortunately, it is impossible to independently verify the findings using that site since likely both of these cases need to be true:
1. Have an account on that site
2. Have that account on that site
I had indeed found that particular site but alas have no account to log in with. This may be related to the obscure fact that my own website makes absolutely NO money and actually costs me to keep it going. ;)
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#19
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,654 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

This may be related to the obscure fact that my own website makes absolutely NO money and actually costs me to keep it going. ;)

Nothing actually obscure, it is obvious: you are simply NOT using Alleycode! ;)

:lol:

jaclaz

#20
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,845 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
I am swithcing to alleycode in the hope I can make way more than the @2 bucks a day I do!!!

#21
Justin90

Justin90

    Newbie

  • Member
  • 15 posts
  • Joined 14-November 11
  • OS:Windows 7 x64
  • Country: Country Flag
LOL! You guys are hilarious. But yes that's his charging terminal for credit cards.

But OK I'm going to try that new code in the cmd prompt in a minute...

If it doesn't work, I found a way to remove the four numbers > off of it, but if i could remove all of it at once that'd be much easier.

All I did was use the replace feature... the first four numbers I ran as **** and then added the >

so replace ****> with nothing = good bye annoying numbers ;)

Edited by Justin90, 17 November 2011 - 09:56 AM.


#22
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,845 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
Well then see his "Website" income actually has NOTHING to do with the coding. It is due to the fact that he charges a buck fifty or more per credit card use......


BTW how can I get the preview pane in alleycode to show transparent images like they should be shown?

Edited by Kelsenellenelvian, 17 November 2011 - 10:00 AM.


#23
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,654 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag

If it doesn't work, I found a way to remove the four numbers > off of it, but if i could remove all of it at once that'd be much easier.

All I did was use the replace feature... the first four numbers I ran as **** and then added the >

so replace ****> with nothing = good bye annoying numbers ;)


Alleycode supports wildcard characters ! :thumbup :angel

jaclaz




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users