Jump to content
Sign in to follow this  
inov8iv

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

Recommended Posts

inov8iv

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

Share this post


Link to post
Share on other sites
Valuater

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

Share this post


Link to post
Share on other sites
inov8iv

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

Share this post


Link to post
Share on other sites
Valuater

Welcome

8)


NEWHeader1.png

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
Sign in to follow this  

×