Hi, I'm a beginner to programming and i've looked all over the net for an answer and I can't find an answer to my problem. I found one that was close but coded in vb 6 and when I tried to upgrade the code with 2008 it wouldn't work and my debugging skills are...novice at best. Here's the text file I need to extract data from:
--------------------------------------------------
ftp> Connected to 10.100.50.25.
open 10.100.50.25
220 JD FTP Server Ready.
User (10.100.50.25none)):
331 Enter password.
230-Hewlett-Packard FTP Print Server Version 2.4.5
Directory: Description:
------------------------------------------------------
PORT1 Print to port 1 hp LaserJet 4250
To print a file, use the command: put <filename> [portx]
or 'cd' to a desired port and use: put <filename>.
Ready to print to PORT1
230 User logged in.
ftp> quit
221 Goodbye.
-------------------------------------------------------
This file is ftp data from an hp jetdirect printer and I've piped it to a text file
called log.txt. What I need to extract is just the name of the printer in question which here is listed on line 12 at character space 34 "hp laserjet 4250". All i need is to extract from line 12 starting at space 34 until the EOL and parse that string to another variable to use in a query of a printer database. The start of the string (hp) will always be on the same line and in the same place on the line it's just the rest of the string that varies depending on what jetdirect card I ftp to. I hope I've explained this clearly enough and that someone can either show me the code i need or point me in the right direction. Thanks in advance!
--------------------------------------------------
ftp> Connected to 10.100.50.25.
open 10.100.50.25
220 JD FTP Server Ready.
User (10.100.50.25none)):
331 Enter password.
230-Hewlett-Packard FTP Print Server Version 2.4.5
Directory: Description:
------------------------------------------------------
PORT1 Print to port 1 hp LaserJet 4250
To print a file, use the command: put <filename> [portx]
or 'cd' to a desired port and use: put <filename>.
Ready to print to PORT1
230 User logged in.
ftp> quit
221 Goodbye.
-------------------------------------------------------
This file is ftp data from an hp jetdirect printer and I've piped it to a text file
called log.txt. What I need to extract is just the name of the printer in question which here is listed on line 12 at character space 34 "hp laserjet 4250". All i need is to extract from line 12 starting at space 34 until the EOL and parse that string to another variable to use in a query of a printer database. The start of the string (hp) will always be on the same line and in the same place on the line it's just the rest of the string that varies depending on what jetdirect card I ftp to. I hope I've explained this clearly enough and that someone can either show me the code i need or point me in the right direction. Thanks in advance!