Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Exporting to Text

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,42926
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Exporting to Text
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 Exporting to Text - 2/6/2007 9:37:25 PM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
Hi Guys/Gals

i have created a script which runs a program and exports the results to a text file how ever the layout in the text file is coming out 12 charcters per inch.  is their a command i can use to set this to be 14 charcters per inch???



Main
Sub Main() 
Dim String1
Dim String2
Dim String3
Dim String4
Dim CmdLine
'name of the export file 
String1 = "c:\Quantum\Q066DAY"
String1 = String1 & Mid(cstr(Year(Now)),4,1)

if Month(Now) < 10 then
 string2 = string2 & "0" & cstr(Month(Now))
else
 string2 = string2 & cstr(Month(Now))
end if
if Day(Now) < 10 then
 string2 = string2 & "0" & cstr(Day(Now))
else
 string2 = string2 & cstr(Day(Now))
end if
String3 = ".txt"  
String4 = String1 & String2 & String3
'run the command line
Set WshShell=WScript.CreateObject("WScript.Shell")

' need to put in path to application
CmdLine = Chr(34) & "\\aaukldnqtappcls\Programs$\GLIFACE.EXE" & Chr(34)
CmdLine = CmdLine & " AUTORUN=" & Chr(34) & "AA Plc Daily" & Chr(34)
CmdLine = CmdLine & " /SYS OUTPUT=FILE ( FILENAME=" & String4 & " STYLE=TXT REPORT=AA066CSH)"
WshShell.Run CmdLine

End Sub
 
 
Post #: 1
 
 RE: Exporting to Text - 2/6/2007 9:46:42 PM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
ill explain a little more, when i run the script the following application is run:

\\aaukldnqtappcls\Programs$\GLIFACE.EXE

it then uses the following paramater with in the reporting application:

"AA Plc Daily"

it then runs the following report:

AA066CSH


The first part of the script sets up the export file name and location of export file to be placed. please please help its really urgent.

(in reply to ylafia)
 
 
Post #: 2
 
 RE: Exporting to Text - 2/7/2007 12:59:46 AM   
  Country73


Posts: 716
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
I'm not exactly sure what you want our assistance on?
This doesn't look like an issue with VBScript, but with the application you are running (GLIFACE.EXE).

You may want to look into the options of that program to see if there are any commandlines to adjust its output.

(in reply to ylafia)
 
 
Post #: 3
 
 RE: Exporting to Text - 2/7/2007 2:30:40 AM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
The GLIFACE has been set up to export 14 charcters per inch and when i manually run the report from gliface.exe the output text file is in the correct format.  Its ONLY when i use the script to run this process i get an incorrect format, so i thought i may need to alter script to force a 14 charcters per inch output file.

please assist

(in reply to Country73)
 
 
Post #: 4
 
 RE: Exporting to Text - 2/7/2007 3:25:49 AM   
  Country73


Posts: 716
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
What happens if you manually run your "CmdLine" manually from a command line?
Does it still export 14 characters per inch, or is it in 12 characters per inch?
You may have to make an adjustment to the command line itself to get the results your looking for. (if possible)

(in reply to ylafia)
 
 
Post #: 5
 
 RE: Exporting to Text - 2/7/2007 4:08:45 AM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
I am trying to find a command to set charcters per inch to 14 but i do not know what that command is.  My understanding of VB Scripts is very small so i would really really appreciate the help.

The command line alone does not produce a text file as if you analyse my script you will see the location of exported file and name are set at the beginning of the script.

if anyone has read all the above and has a suggestion please post as i have been working on this for sometime and i just cant get it to work.

(in reply to Country73)
 
 
Post #: 6
 
 RE: Exporting to Text - 2/7/2007 4:16:53 AM   
  dm_4ever


Posts: 2559
Score: 40
Joined: 6/29/2006
From: Orange County, California
Status: offline
It looks like you're building the text file name so why don't you just modify it to add the additional characters you need?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ylafia)
 
 
Post #: 7
 
 RE: Exporting to Text - 2/14/2007 11:17:21 PM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
quote:

It looks like you're building the text file name so why don't you just modify it to add the additional characters you need?


the additional text is random depending on whats in the database so i can not set it in stone on script.  is their a command i can add to script to define the text file format as 14 characters per inch?

(in reply to dm_4ever)
 
 
Post #: 8
 
 RE: Exporting to Text - 2/25/2007 8:14:31 PM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
Does anyone know how to code characters per inch in a txt file?

(in reply to ylafia)
 
 
Post #: 9
 
 RE: Exporting to Text - 2/26/2007 1:35:01 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Simple text files do not provide the metadata required for complex formatting like characters per inch. YOu would need to store it in a more complex file type such as a word document or a PDF I believe.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ylafia)
 
 
Post #: 10
 
 RE: Exporting to Text - 2/26/2007 10:04:54 PM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
i have the following options i can store the file in CSV, TXT, REC, TBS, or TBF.  The TXT option displays in the wrong format how ever the others display correctly but with speach marks around the data.

Below is how the output displays in various formats when running my scrpt.

CSV, REC, TBS & TBF
"L0592007020220070202RON000003913400.00CR00076419          RON  FX :133620" "actual_pos            ."

TXT
L0592007020220070202RON000003913400.00CR00076419          RON  actual_pos           

The actual format i require so that SAP can pick up the data is as follows:

L0592007020220070202RON000003913400.00CR00076419          RON  FX :133620 actual_pos            . 


is their a new script i can design to modify the csv, rec, tbs or tbf text format to remove all the speach marks?

(in reply to ebgreen)
 
 
Post #: 11
 
 RE: Exporting to Text - 2/27/2007 12:59:54 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Well, if the data will never have "s in it then, you can use the Replace() function to remove them.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ylafia)
 
 
Post #: 12
 
 RE: Exporting to Text - 2/27/2007 2:45:24 AM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
how do i use this function?
just say i wanted to delete all instances of "  in the text file

(in reply to ebgreen)
 
 
Post #: 13
 
 RE: Exporting to Text - 2/27/2007 2:46:57 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
I would suggest reading the "Read me first" post and getting the documentation. Then searching this forum for replace.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ylafia)
 
 
Post #: 14
 
 RE: Exporting to Text - 2/27/2007 2:54:23 AM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
i have read it what have i done wrong? 

(in reply to ebgreen)
 
 
Post #: 15
 
 RE: Exporting to Text - 2/27/2007 2:55:09 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
I don't know. What is your code?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ylafia)
 
 
Post #: 16
 
 RE: Exporting to Text - 2/27/2007 2:56:26 AM   
  Country73


Posts: 716
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
Items in RED are optional.

Replace(
expression, find, replacewith, start, count, compare)

Example:

Dim MyString
'A binary comparison starting at the beginning of the string:
MyString = Replace("XXpXXPXXp","p","Y")
'Returns "XXYXXPXXY"

'A textual comparison starting at position 3.
MyString = Replace("XXpXXPXXp", "p", "Y", 3, -1, 1)
'Returns "YXXYXXY"

(in reply to ylafia)
 
 
Post #: 17
 
 RE: Exporting to Text - 2/27/2007 3:10:42 AM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
Sorry guys im lost my experience in scripting is not as vast as yourselves and im a real novice. ill explain first look at the below code.


      

Originally the text file that the above code produces was coming out with 12 Charcters Per Inch which was the wrong format.  i asked for advise for a command to cover this to 14 CPI text format but no one knew how.  So by investigating further i discovered by changing the style from TXT to TBS or TBF in the code it gave me the correct format with one issue which was the unwanted speech marks.  so how do i overcome this?

(in reply to Country73)
 
 
Post #: 18
 
 RE: Exporting to Text - 2/27/2007 3:16:31 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
So after you run this you wind up with a file \\163.197.117.41\Quantum\Q059DAY and that is the one that you want to remove the "s from?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ylafia)
 
 
Post #: 19
 
 RE: Exporting to Text - 2/27/2007 3:22:18 AM   
  ylafia

 

Posts: 14
Score: 0
Joined: 2/6/2007
Status: offline
yeah i wind with a file in this location \\163.197.117.41\Quantum\ called Q059DAY with the date in the filename after Q059DAY.

so if i run it today i ended up with a file called Q059DAY70226DET.txt which i need to remove all " from.

(in reply to ebgreen)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Exporting to Text Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts