![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
PFO Founder
![]() ![]() |
ok i have a vb program im writing that sends an argument to our an awk script on one of our linux servers, and then returns a report to my vb program to be displayed. But now i have a problem of getting extra spaces in the page. here is some of the report i get back.
7101088 155gm1b% 0
INPROCESS
88059 278/ 300 162 0 06-23-04 07-16-04 07-12-04
88543 300/ 300 0 0 07-12-04 08-02-04
ORDERS
UX:sh (sh): ERROR : cnvtmast : Not found
ECN FILE /u/in.dt/ecn/melg/eajcyv
7101088 copied from 6732801
6732801
|------------------------------------------------------------------------------|
ADVANCED QUALITY PLANNING CHECKLIST:
Cust:_Bobcat-Gwinner______ Used on model:______________ EAU: __________and here is what it is suppose to look like, or what it looks like when i just run the awk script from linux and if i put the output into a text file and open it in say textpad or a good text editor. 7101088 155gm1b% 0
INPROCESS
88059 278/ 300 162 0 06-23-04 07-16-04 07-12-04
88543 300/ 300 0 0 07-12-04 08-02-04
ORDERS
96 04-07-19K BOBCAT-GWN
141 04-07-26K BOBCAT-GWN
142 04-08-02K BOBCAT-GWN
2 04-08-03 BOBCAT-SERV
133 04-08-09K BOBCAT-GWN
ECN FILE /u/in.dt/ecn/melg/eajcyv
7101088 copied from 6732801
6732801
|------------------------------------------------------------------------------|
ADVANCED QUALITY PLANNING CHECKLIST:
Cust:_Bobcat-Gwinner______ Used on model:______________ EAU: __________so my question is how would you go about getting rid of the extra white space. i would normally just write a routine that would remove a certain amount of spaces per line but since the extra spaces in every line isnt the same that wont work. so i was wondering what would be the best way to do this. thanks
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() |
Is there a way that you can just run the awk script and output to a text file, then read it in vb from the text file. Kinda barberic, but it would work.
-Pizentios
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#3 | |
|
Programming Guru
![]() ![]() |
Quote:
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
|
#4 |
|
PFO Founder
![]() ![]() |
well i dont think it has anything to do with the error. that is something wrong with the awk script with i call it using vb. but i dont know if that putting the output into a text file first would work because there is still the idea of it being a unix text file and moving it to windows, which messes up the way things are formatted. but i will give it a try
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() |
unix -> windows = no prob
windows-> unix = headache. windows ->unix != fun. -Pizentios
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#6 |
|
PFO Founder
![]() ![]() |
converting a text file so it looks good either way is pretty easy i have writen a text editor that will do that. it will open a unix text file and then read it and make it look good in windows and then when you save it it will convert it back to unix text file
it was pretty easy once i knew what i had to do
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#7 |
|
PFO Founder
![]() ![]() |
well im making progress this is what i have it printing out now
7101088 155gm1b% 0
INPROCESS
88059 278/ 300 162 0 06-23-04 07-16-04 07-12-04
88543 300/ 300 0 0 07-12-04 08-02-04
ORDERS
UX:sh (sh): ERROR : cnvtmast : Not found
ECN FILE /u/in.dt/ecn/melg/eajcyv
7101088 copied from 6732801
6732801
|------------------------------------------------------------------------------|
ADVANCED QUALITY PLANNING CHECKLIST:
Cust:_Bobcat-Gwinner______ Used on model:______________ EAU: __________this is the current code i am using Option Explicit
Public strCommand As String
Public s As String
Private Sub Form_Load()
Dim startpos As Integer, thispos As Integer
Dim startpos2 As Integer, thispos2 As Integer
Dim startpos3 As Integer, thispos3 As Integer
strCommand = "/util/pninfo " + command
s = sendCommand(strCommand)
startpos = 1
Do While True
thispos = InStr(startpos, s, Chr(10))
If thispos = 0 Then Exit Do
s = Left(s, thispos - 1) & Chr(13) & Chr(10) & Mid(s, thispos + 1) ' replace chr(10) with chr(13) & chr(10)
startpos = thispos + 2
DoEvents
Loop
Dim strleft As String, strright As String
startpos2 = 1
Do While True
thispos2 = InStr(startpos2, s, Chr(32))
If thispos2 = 0 Then Exit Do
strleft = Left(s, thispos2)
strleft = Trim(strleft)
s = strleft & " " & Mid(s, thispos2 + 1) 'replaces leading and following spaces
startpos2 = thispos2 + 2
Loop
txtReturned.Text = s
End Sub
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#8 |
|
Programming Guru
![]() ![]() |
That's the output that you read from the text file??
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#9 |
|
PFO Founder
![]() ![]() |
nope that is the output after using vb to strip the leading and following spaces the code is posted above
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
|
|
#10 | |
|
Programming Guru
![]() ![]() ![]() |
Quote:
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|