Jump to content
Sign in to follow this  
keen

Help

Recommended Posts

keen

How would I make something like this:

"420","UR 2.5†Stainless Steel Cat-Back Exhaust : Mitsubishi Evolution (03-06+)","444.00","0.00","0.00","0.00","0","1","yes","0",NULL,NULL,"UR 2.5†Stainless Steel Cat-Back Exhaust System: Mitsubishi Lancer Evolution (03-06+)","<P class=MsoNormal style=""MARGIN: 0in 0in 10pt""><FONT face=Calibri size=3>- 2.5%u201D Stainless Steel Construction<BR>- Straight-through Muffler Design with Rolled Polished Tip</FONT></P>","Fits: Lancer Evolution (03-05), Lancer Evolution (06+)","1",,"0","0",,"products/420_image.jpg","products/420_thumbnail_image.jpg",,"20.0000","12.0000","18.0000","36.0000",,"UR20100","2007-08-17 14:15:00","0","0.0000","0.0000","0.0000","0.0000","default","0.00",,"1","2","5","0","0.00","0","0","0","1","0","ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06","ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06
ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06
"

into this:

INSERT INTO Products (`\"420\",\"UR 2.5Ââ€`, `Stainless Steel Cat-Back Exhaust : Mitsubishi Evolution (03-06+)\",\"444.00\",\"0.00\",\"0.00\",\"0.00\",\"0\",\"1\",\"yes\",\"0\",NULL,NULL,\"UR 2.5Ââ€`, `Stainless Steel Cat-Back Exhaust System: Mitsubishi Lancer Evolution (03-06+)\",\"

- 2.5%u201D Stainless Steel Construction
- Straight-through Muffler Design with Rolled Polished Tip
\",\"Fits: Lancer Evolution (03-05), Lancer Evolution (06+)\",\"1\",,\"0\",\"0\",,\"products/420_image.jpg\",\"products/420_thumbnail_image.jpg\",,\"20.0000\",\"12.0000\",\"18.0000\",\"36.0000\",,\"UR20100\",\"2007-08-17 14:15:00\",\"0\",\"0.0000\",\"0.0000\",\"0.0000\",\"0.0000\",\"default\",\"0.00\",,\"1\",\"2\",\"5\",\"0\",\"0.00\",\"0\",\"0\",\"0\",\"1\",\"0\",\"ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06\",\"ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06`) VALUES ('ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06'); 
INSERT INTO Products (`\"420\",\"UR 2.5Ââ€`, `Stainless Steel Cat-Back Exhaust : Mitsubishi Evolution (03-06+)\",\"444.00\",\"0.00\",\"0.00\",\"0.00\",\"0\",\"1\",\"yes\",\"0\",NULL,NULL,\"UR 2.5Ââ€`, `Stainless Steel Cat-Back Exhaust System: Mitsubishi Lancer Evolution (03-06+)\",\"

- 2.5%u201D Stainless Steel Construction
- Straight-through Muffler Design with Rolled Polished Tip
\",\"Fits: Lancer Evolution (03-05), Lancer Evolution (06+)\",\"1\",,\"0\",\"0\",,\"products/420_image.jpg\",\"products/420_thumbnail_image.jpg\",,\"20.0000\",\"12.0000\",\"18.0000\",\"36.0000\",,\"UR20100\",\"2007-08-17 14:15:00\",\"0\",\"0.0000\",\"0.0000\",\"0.0000\",\"0.0000\",\"default\",\"0.00\",,\"1\",\"2\",\"5\",\"0\",\"0.00\",\"0\",\"0\",\"0\",\"1\",\"0\",\"ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06\",\"ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06`) VALUES ('\"');

And I need it to handle multiple inputs in one file.


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites
ACS

Your request seems ridiculously straight-forward. All you're doing is taking existing text fields, which already appear to be properly comma-delimited, and just adding some formatting.

You can do simple string concatenation using ampersand (&) or you can use the StringFormat function, which would probably make things a lot easier.

I suggest that before you ask for help, you should at least make the effort to try things for yourself. After all, it's the best way to learn.

Share this post


Link to post
Share on other sites
keen

I know that, I just can never get it working. Can you help me out?


[center]Kesne's Bar & Grill[/center]

Share this post


Link to post
Share on other sites
ACS

I've already given you a bit of a head start. Read the documentation regarding StringFormat, and try some things out yourself. AutoIt documention is quite good, and always the best place to start.

Share this post


Link to post
Share on other sites
weaponx

It looks like you are trying to reverse engineer a crappy Word html file. Where is the data coming from?

Share this post


Link to post
Share on other sites
Authenticity

Dim $sText = '"420","UR 2.5Ãâ Stainless Steel Cat-Back Exhaust : Mitsubishi Evolution (03-06+)"' & _
             ',"444.00","0.00","0.00","0.00","0","1","yes","0",NULL,NULL,"UR 2.5Ãâ Stainless Steel' & _
             'Cat-Back Exhaust System: Mitsubishi Lancer Evolution (03-06+)","<P class=MsoNormal style=' & _
             '""MARGIN: 0in 0in 10pt""><FONT face=Calibri size=3>- 2.5%u201D Stainless Steel Construction' & _
             '<BR>- Straight-through Muffler Design with Rolled Polished Tip</FONT></P>","Fits: Lancer Evolution' & _
             '(03-05), Lancer Evolution (06+)","1",,"0","0",,"products/420_image.jpg","products/420_thumbnail_image.' & _
             'jpg",,"20.0000","12.0000","18.0000","36.0000",,"UR20100","2007-08-17 14:15:00","0","0.0000","0.0000",' & _
             '"0.0000","0.0000","default","0.00",,"1","2","5","0","0.00","0","0","0","1","0","ur-25-stainless-steel-' & _
             'cat-back-exhaust-mitsubishi-evolution-03-06","ur-25-stainless-steel-cat-back-exhaust-mitsubishi-' & _
             'evolution-03-06ur-25-stainless-steel-cat-back-exhaust-mitsubishi-evolution-03-06"'
             
Dim $sFormat = StringRegExpReplace($sText, '"', '\\"')
$sFormat = "INSERT INTO Products ('" & $sFormat & "`) VALUES ('\""');"
ConsoleWrite($sFormat & @LF)

?

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  

×