Jump to content

Help Splitting/Parsing a string at a given character.*RESOLVED*


inov8iv
 Share

Recommended Posts

What I currently have ==>>

Dodge Muffler Bracket *Chrome*$6.00 0 --

Dodge Muffler Bracket Blk$2.00 12 --

What I want to have ==>>

Dodge Muffler Bracket *Chrome*$6.00

Dodge Muffler Bracket Blk$2.00

I have tried [ $line = StringRight(StringInStr($line, "."), 2) ] It is probably a simple solution, but I can't find the correct parameter.

VBCode Looks like this: [ $line = Left$($line, InStr($line, ".") + 2) ]

TIA

Edited by inov8iv
Link to comment
Share on other sites

Kinda like...

#cs
What I currently have ==>>
Dodge Muffler Bracket *Chrome*$6.00 0 --
Dodge Muffler Bracket Blk$2.00 12 --

What I want to have ==>>
Dodge Muffler Bracket *Chrome*$6.00
Dodge Muffler Bracket Blk$2.00

I have tried [ $line = StringRight(StringInStr($line, "."), 2) ] It is probably a simple solution, but I can't find the correct parameter.

VBCode Looks like this: [ $line = Left$($line, InStr($line, ".") + 2) ]
#ce

$D_Muff_bracket_Chrome = "*Chrome*$6.00 0 --"
$D_Muff_bracket_Blk = "Blk$2.00 12 --"

$line1 = StringLeft( $D_Muff_bracket_Chrome, StringInStr($D_Muff_bracket_Chrome, ".") + 2)

MsgBox(0,"test", $line1)

$line2 = StringLeft( $D_Muff_bracket_Blk, StringInStr($D_Muff_bracket_Blk, ".") + 2)

MsgBox(0,"test", $line2)

8)

NEWHeader1.png

Link to comment
Share on other sites

I got this to work,

#include <array.au3>
$line = "Dodge Muffler Bracket *Chrome*$10.00 0 -- "
$line0 = StringSplit($line, ".")
$result = $line0[1] & "." & StringLeft($line0[2], 2) 
MsgBox(0, "What I have Now...", $result)

Your way may work better for my needs, thanks a bunch..... :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...