You are awesome!
I was just experimenting with a line just like this that I found on another site.
It works!
I also had to make sure my text file used a space delimiter versus a tab.
Thanks for all your help.
Thanks for your help. I think you are very close to figuring it out.
Here is what I am getting for output:
file.list:
123.123.123.123 1000
123.123.123.124 1001
# for IList in `cat file.list | awk '{print $0}'`; do
> echo "$IList";
> done
123.123.123.123
1000
123.123.123.124
1001
Here...
I have a file with a list of IPs and a 2nd field: x.x.x.x | 1234
I have an Expect script that requires input:
./runme.exp x.x.x.x 1234
I would like to read the file and use it in the script so I could run the script on multiple servers in a row.
I am a hack when it comes to Perl. I figured I could get rid of all of the LWP, url and browser references. Is there another module that would help with windows file access?
I am trying to replace the $url with a file directory location.
Is there a way I can replace the following:
my...
All,
In the past I had a bunch of csv or text files sitting on a web server. My script would loop through all of the folders on the web server and pull out the parts of the files that I wanted.
Recently these files have been moved from the web server to a shared drive that I do not control. I...
I found a solution for this problem. I ended up using a sed regular expression to remove all of the special characters and create a new cleaned file.
RF
Does anyone know the way to call this from withing Expect?
Expect seems to choke on the ^w\. and does not continue.
I have tried set content [regsub -all {[^\w\.]} $newName "" newName ] but this does not work either.
Thanks,
JB
As you can see from my recent posts I am new to Expect
I have everything working close to the way I want it now for my data collection. I just a have a couple small issues.
1. The script below adds a non-ascii character to the end of the file name. Is there a better way to do this?
set tdate...
I have redirected the output from my telnet session to a text file.
The text file contains ANSI characters that I do not want, example:
Erase from cursor to end of screen \027[J or \027[0J
[H[J
Is there a way to suppress these characters so that they do not show up in the output file?
Current script:
set tdate [clock format [clock seconds] -format %Y%m%d]
set newName ofcvar_
append newName $tdate
append newName ".txt"
send "expect -f ofcvar.txt > $newName\r"
This gives me a new file like ofcvar_20080919.txt
When I type in the commands above at the expect prompt it works...
This is awesome. Thanks for your help.
One more question.
When I type in the commands above at the expect prompt it works exactly like I wanted it but when I type the commands into a new tcl file and execute it it fails to send the last command successfully.
set tdate [clock format [clock...
Thanks for the quick response.
If ofcvar.txt is my command reference for the expect script and I add this line of code within the file how would I call it to create the file name with the date?
My current ofcvar.txt file contents, simple I know:
set username xxx
set pass xxx
set host xxx.com...
Hello,
I am new to TCL and Expect. I wrote an Expect script that pulls the data that I want but I would like to pull it every day and automatically assign the days date as part of the file name.
I tried playing around with exec data but I could not get teh syntax down.
my current code:
#...
Awesome!
I didn't even see that line for some reason. This will make my life so easy. I can't thank you enough.
Notes for people searching with the same issue:
vertical records, Motorola, text reports, transpose, import
RF101
"unpack", This is what I needed. Thank you very much for this contribution.
When I run the script above I get the following output:
03/06/2008 08:00 19.0
03/06/2008 08:00 19.0
03/06/2008 08:00 19.0
03/06/2008 08:00 19.0
This is correct. This is the first three fields for each record...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.