• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
Justin90

Text replacement question.

23 posts in this topic

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.

0

Share this post


Link to post
Share on other sites

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

What is Alleycode? Is it an online HTML editor?

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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: :

  1. Pogrammers
  2. Web developers
  3. Kids
  4. Electricians and Plumbers
  5. Other

jaclaz

Edited by jaclaz
0

Share this post


Link to post
Share on other sites

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: :

  1. Pogrammers
  2. Web developers
  3. Kids
  4. Electricians and Plumbers
  5. Other

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

Edited by Justin90
0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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:

$option = Get-Content .\option.xml

To output to screen:

$option.select.option

To output to file:

$option.select.option | out-file .\options.txt

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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. ;)

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

I am swithcing to alleycode in the hope I can make way more than the @2 bucks a day I do!!!

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.