Using a "Scheduled Task" on a cisco controller to output data to a text file
Can someone tell me if there is a way to run a Cron Job, RBA, or some other automated process on an 8510? The idea would be to run the job every 5mins, and output the data to a text file. Is this possible?
In your script - you might be able to capture the error by putting your code inside a try/catch block. Something like:
try {
# do stuff
} catch {
$error.message | out-file c:\temp\script.txt
G. Samuel Hays, MCT, MCSE 2012, MCITP: Enterprise Admin
Blog:gsamuelhays.blogspot.com
twitter:twitter.com/gsamuelhays
Similar Messages
-
I would like to plott data from a text file in the same way as a media player does from a video file. I’m not sure how to create the pointer slide function. The vi could look something like the attached jpg.
Please, can some one help me?
Martin
Attachments:
Plotting from a text file like a media player example.jpg 61 KBHI Martin,
i am not realy sure what you want!?!?
i think you want to display only a part of the values you read from XYZ
so what you can do:
write all the values in an array.
the size of the array is the max. value of the slide bar
now you can select a part of the array (e.g. values from 100 to 200) and display this with a graph
the other option is to use the history function of the graphes
regards
timo -
How can I use Automator to extract specific Data from a text file?
I have several hundred text files that contain a bunch of information. I only need six values from each file and ideally I need them as columns in an excel file.
How can I use Automator to extract specific Data from the text files and either create a new text file or excel file with the info? I have looked all over but can't find a solution. If anyone could please help I would be eternally grateful!!! If there is another, better solution than automator, please let me know!
Example of File Contents:
Link Time =
DD/MMM/YYYY
Random
Text
161 179
bytes of CODE memory (+ 68 range fill )
16 789
bytes of DATA memory (+ 59 absolute )
1 875
bytes of XDATA memory (+ 1 855 absolute )
90 783
bytes of FARCODE memory
What I would like to have as a final file:
EXCEL COLUMN1
Column 2
Column3
Column4
Column5
Column6
MM/DD/YYYY
filename1
161179
16789
1875
90783
MM/DD/YYYY
filename2
xxxxxx
xxxxx
xxxx
xxxxx
MM/DD/YYYY
filename3
xxxxxx
xxxxx
xxxx
xxxxx
Is this possible? I can't imagine having to go through each and every file one by one. Please help!!!Hello
You may try the following AppleScript script. It will ask you to choose a root folder where to start searching for *.map files and then create a CSV file named "out.csv" on desktop which you may import to Excel.
set f to (choose folder with prompt "Choose the root folder to start searching")'s POSIX path
if f ends with "/" then set f to f's text 1 thru -2
do shell script "/usr/bin/perl -CSDA -w <<'EOF' - " & f's quoted form & " > ~/Desktop/out.csv
use strict;
use open IN => ':crlf';
chdir $ARGV[0] or die qq($!);
local $/ = qq(\\0);
my @ff = map {chomp; $_} qx(find . -type f -iname '*.map' -print0);
local $/ = qq(\\n);
# CSV spec
# - record separator is CRLF
# - field separator is comma
# - every field is quoted
# - text encoding is UTF-8
local $\\ = qq(\\015\\012); # CRLF
local $, = qq(,); # COMMA
# print column header row
my @dd = ('column 1', 'column 2', 'column 3', 'column 4', 'column 5', 'column 6');
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
# print data row per each file
while (@ff) {
my $f = shift @ff; # file path
if ( ! open(IN, '<', $f) ) {
warn qq(Failed to open $f: $!);
next;
$f =~ s%^.*/%%og; # file name
@dd = ('', $f, '', '', '', '');
while (<IN>) {
chomp;
$dd[0] = \"$2/$1/$3\" if m%Link Time\\s+=\\s+([0-9]{2})/([0-9]{2})/([0-9]{4})%o;
($dd[2] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of CODE\\s/o;
($dd[3] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of DATA\\s/o;
($dd[4] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of XDATA\\s/o;
($dd[5] = $1) =~ s/ //g if m/([0-9 ]+)\\s+bytes of FARCODE\\s/o;
last unless grep { /^$/ } @dd;
close IN;
print map { s/\"/\"\"/og; qq(\").$_.qq(\"); } @dd;
EOF
Hope this may help,
H -
How to read a tab seperated data from a text file using utl_file
Hi,
How to read a tab seperated data from a text file using utl_file...
I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....
Thanks in advance...
NaveenNaveen Nishad wrote:
How to read a tab seperated data from a text file using utl_file...
I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....If it's a text file then UTL_FILE will only allow you to read it a line at a time. It is then up to you to split that string up (search for split string on this forum for methods) into it's individual components.
If the text file contains a standard structure on each line, i.e. it is a fixed delimited structure, then you could use external tables to read the data instead. -
Reading data from a text file but can't use the data outside of the function.
I am trying to load a variable from data in a text file.
I can read the text file fine but the variable data seems
only to be available with in the function that reads it.
I need to use the variable data outside of the function.
Does anyone have any suggestions to work around this issue?
This is the actionscript code i'm using.
var pathVars= new LoadVars();
pathVars.onLoad=function(ok) {
if(ok)
trace("Loading");
path_var=pathVars.path;
trace("This is within the function "+path_var);
pathVar0="This is within the function... "+path_var;
Yet the path_var is available here fine.
pathVars.load("mypath.txt");
This is where the path_var becomes undefined
trace("This is outside the function... "+path_var);
pathVar1="This is outside the function... "+path_var;
This
is a download link for the FLA zip file
This
is a demo of the script loading the text fileThe external traces are being executed before the file is
loaded. -
1 Analog Input using a DAQ card and would like to save the data into an excel file
As you may have realized, I am very new at using Labview 6.1. I have an analog voltage input that I would like to save in an Excel file as a 2D array (time, voltage). I was wondering if anyone knew a very simple way of doing this and could help me out. Thanks
There are a couple example program online and in LabVIEW that I think you’ll find useful. You might want to consider just writing out a tab-delimited spreadsheet file that Excel can read rather than writing it out to Excel directly as this requires learning ActiveX and Microsoft’s Common Object Model.
In LabVIEW, see the Write to Text File.vi in C:\Program Files\National Instruments\LabVIEW 7.1\examples\file\smplfile.llb. Writes simulated, timestamped data to a text file in ASCII format that can be read by spreadsheet applications.
Online, you can look at:
Stream Scaled Data (Voltages) to a Spreadsheet File
Chart Analog Data from File, Using the Cont Acq to Spreadsheet.vi Example
Hope this helps. Best of luck!
Kileen -
Scheduling multiple tab BO XI3 report needs to save into multiple text file
Hi,
I have BO XI 3 Desktop Intelligence reports, those reports contains multiple tabs. Once after scheduling these reports the output needs to save as different text files (each tab as separate text file). Generally when select output as text file we will get the text file with the data of current tab, but in this scenario I want all the tabs data into different text files. I guess we can do this with macro. But I am not good in macro development, hope somebody can help me.
Could you please help out for the same!
Thanks,
RamaThanks Dan.. I made chenges in code as per your suggestion.. its working fine in DeskI -> local PC
But this is not working in InfoView level... when i scheduled the same report its not saving into multiple text files... can you please have look...
macro code as follows:-
Public Sub SaveAsText()
Dim StrTxtPath As String
Dim BusDoc As busobj.Document
Set BusDoc = ThisDocument
Dim BusRep As Report
Dim I As Integer
On Error GoTo ErrHandler
'StrTxtPath = "
xxxx.xxx.xxx.com\common\Reporting\"
StrTxtPath = "D:\Business Objects\Test_Macro\"
For I = 1 To BusDoc.Reports.Count
Set BusRep = BusDoc.Reports.Item(I)
BusRep.ExportAsText (StrTxtPath & BusRep.Name)
Next I
ErrHandler:
Exit Sub
End Sub
When i run this macro through DeskI.. its saving the report as multiple .txt files with respective number of tabs... but the same thing is not working when i tried in scheduling...
Can you please suggest me what are the changes needs to be done...
Thanks in Advance
Thanks,
Rama -
Loading the data from a text file to a table using pl/sql
Hi Experts,
I want to load the data from a text (sample1.txt) file to a table using pl/sql
I have used the below pl/sql code
declare
f utl_file.file_type;
s varchar2(200);
c number := 0;
begin
f := utl_file.fopen('TRY','sample1.txt','R');
loop
utl_file.get_line(f,s);
insert into sampletable (a,b,c) values (s,s,s);
c := c + 1;
end loop;
exception
when NO_DATA_FOUND then
utl_file.fclose(f);
dbms_output.put_line('No. of rows inserted : ' || c);
end;
and my sample1.txt file looks like
1
2
3
The data is getting inserted, with below manner
select * from sampletable;
A B C
1 1 1
2 2 2
3 3 3
I want the data to get inserted as
A B C
1 2 3
The text file that I have is having three lines, and each line's first value should go to each column
Please help...
Thanksdeclare
f utl_file.file_type;
s1 varchar2(200);
s2 varchar2(200);
s3 varchar2(200);
c number := 0;
begin
f := utl_file.fopen('TRY','sample1.txt','R');
utl_file.get_line(f,s1);
utl_file.get_line(f,s2);
utl_file.get_line(f,s3);
insert into sampletable (a,b,c) values (s1,s2,s3);
c := c + 1;
utl_file.fclose(f);
exception
when NO_DATA_FOUND then
if utl_file.is_open(f) then utl_file.fclose(f); ens if;
dbms_output.put_line('No. of rows inserted : ' || c);
end;SY. -
Using JTables to display data from a text file
How do I display data from a .txt file into a column inside a JTable?
dont quite get the "vectors" part..
by the way, my program is as follows
* Damn Java ..
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
public class ScoreBoard extends JPanel {
private boolean DEBUG = false;
public ScoreBoard() {
super(new GridLayout(1,0));
String[] columnNames = {"Player's Name",
"Time Completed",
"$ Amount Earned $"};
/* Object[][] data = {
{"1",
new Integer(5), new Integer(500)},
{"2",
new Integer(5), new Integer(3200)},
{"3",
new Integer(5), new Integer(1000)},
{"4",
new Integer(5), new Integer(100)},
{"5",
new Integer(5), new Integer(200)},
final JTable table = new JTable(data, columnNames);
table.setPreferredScrollableViewportSize(new Dimension(600, 90));
if (DEBUG) {
table.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
printDebugData(table);
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Add the scroll pane to this panel.
add(scrollPane);
private void printDebugData(JTable table) {
int numRows = table.getRowCount();
int numCols = table.getColumnCount();
javax.swing.table.TableModel model = table.getModel();
System.out.println("Value of data: ");
for (int i=0; i < numRows; i++) {
System.out.print(" row " + i + ":");
for (int j=0; j < numCols; j++) {
System.out.print(" " + model.getValueAt(i, j));
System.out.println();
System.out.println("--------------------------");
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
private static void createAndShowGUI() {
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Create and set up the window.
JFrame frame = new JFrame("ScoreBoard");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Create and set up the content pane.
ScoreBoard newContentPane = new ScoreBoard();
newContentPane.setOpaque(true); //content panes must be opaque
frame.setContentPane(newContentPane);
//Display the window.
frame.pack();
frame.setVisible(true);
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
and i want to display the player name from a textfile.txt to the player column instead of hardcoding it like above. Thanks! -
How to load data in plain-text file into database by using EJB?
Hi,
We need to develop an on-line application which requires us to load input data
from a selected plain-text file on the Web server (iplanet server) into the backend
oracle database. How could I use EJB to make it happen? it seems like using Entity
EJB is not feasible.
Really appreciate your help!
CoronaHi Corona,
"Corona Fang" <[email protected]> wrote in message
news:3f3b0ea3$[email protected]..
We need to develop an on-line application which requires us to load inputdata
from a selected plain-text file on the Web server (iplanet server) intothe backend
oracle database. How could I use EJB to make it happen? it seems likeusing Entity
EJB is not feasible.If you are talking about loading thousands of records,
the preferable way is using plain JDBC calls utilizing
batch methods.
Regards,
Slava Imeshev -
Trying to write data to a text file using java.io.File
I am trying to create a text file and write data to it by using java.io.File and . I am using JDeveloper 10.1.3.2.0. When I try run the program I get a java.lang.NullPointerException error. Here is the snippet of code that I believe is calling the class that's causing the problem:
String fpath = "/test.html";
FileOutputStream out = new FileOutputStream(fpath);
PrintStream pout = new PrintStream(out);
Do I need to add additional locations for source files or am I doing something wrong? Any suggestions would be appreciated.
Thank you.Hi dhartle,
May be that can help:
* Class assuming handling logs and connections to the Oracle database
* @author Fabre tristan
* @version 1.0 03/12/07
public class Log {
private String fileName;
* Constructor for the log
public Log(String name) {
fileName = name;
* Write a new line into a log from the line passed as parameter and the system date
* @param line The line to write into the log
public void lineWriter(String line) {
try {
FileWriter f = new FileWriter(fileName, true);
BufferedWriter bf = new BufferedWriter(f);
Calendar c = Calendar.getInstance();
Date now = c.getTime();
String dateLog =
DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM,
Locale.FRANCE).format(now);
bf.write("[" + dateLog + "] :" + line);
bf.newLine();
bf.close();
} catch (IOException e) {
System.out.println(e.getMessage());
* Write a new line into a log from the line passed as parameter,
* an header and the system date
* @param header The header to write into the log
* @param info The line to write into the log
public void lineWriter(String header, String info) {
lineWriter(header + " > " + info);
* Write a new long number as line into a log from the line
* passed as parameter, an header and the system date
* @param header The header to write into the log
* @param info The line to write into the log
public void lineWriter(String header, Long info) {
lineWriter(header + " > " + info);
* Enable to create folders needed to correspond with the path proposed
* @param location The path into which writing the log
* @param name The name for the new log
* @return Log Return a new log corresponding to the proposed location
public static Log myLogCreation(String location, String name) {
boolean exists = (new File(location)).exists();
if (!exists) {
(new File(location)).mkdirs();
Log myLog = new Log(location + name);
return myLog;
* Enable to create the connection to the DB
* @return Connection Return a new connection to the Oracle database
public static Connection oracleConnectionCreation() throws Exception {
// Register the Oracle JDBC driver
DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
//connecting to the DB
Connection conn =
DriverManager.getConnection("jdbc:oracle:thin:@myComputerIP:1521:myDB","user", "password");
return conn;
* This main is used for testing purposes
public static void main(String[] args) {
Log myLog =
Log.myLogCreation("c:/Migration Logs/", "Test_LinksToMethod.log");
String directory = "E:\\Blob\\Enalapril_LC-MS%MS_MS%MS_Solid Phase Extraction_Plasma_Enalaprilat_ERROR_BLOB_test";
myLog.lineWriter(directory);
System.out.println(directory);
[pre]
This class contained some other functions i've deleted, but i think it still works.
That enables to create a log (.txt file) that you can fill line by line.
Each line start by the current system date. This class was used in swing application, but could work in a web app.
Regards,
Tif -
Use AppleScript or Automator (or both) to get Mail and add to a text file?
Hello all,
I'm sorry if this is a duplicate of a well-known topic, I tried searching and couldn't see anything.
I'm behind a proxy at work that blocks any kind of webmail access, but I'd like to be able to check my email while on a break or something.
I had the idea that I could use Automator or Applescript to check my mail, get the new messages and add the text to a textfile that I could host on my personal webserver that I use for family stuff.
I've tried an automator workflow that seems to work while in Automator, but when I save it as an application, it won't even start Mail to check.
I also thought of just leaving mail running, and have a rule that starts a script when new mail arrives, but I don't know enough about Applescript to do it.
I don't want to confuse anyone with the details of my convoluted ideas, so I'll leave it at that.
Is there a way to do this? I want mail to check the server, download the messages, new messages get their text appended to a text file that's stored in my webserver's directory (same computer) that I can access from the web, and have it repeat every 5 minutes or so.
If I've left out a detail, let me know, and if I'm just stupid and there's an easy way to do this... be kind.
Thanks!
aeix
iMac G5 2.0 GHz Mac OS X (10.4.6)It certainly is going in the right direction. I'm not all that versed in AppleScript, but it looks like that particular script is creating a new text file for every message processed.
I would like to either create a specific text file if it doesn't exist, or append the text to the end of the file if it does exist.
But like I said, definitely heading in the right direction!
iMac G5 2.0 GHz Mac OS X (10.4.6) -
I am using this to create a data set that will be passed as an anolog output therefore it needs to have the correct array dimensions to go into the analog write vi.
I'm updating my request... I've figured out how to do this by copying an example that uses a simple FOR loop (as seen in the attached current version of my VI). My question now becomes this: Is there a way to save the Y values corresponding to those X values into two more arrays? That is, just for argument's sake, let's say I took the first 100 elements from the X array, and found them to be positive. Then I would like to take the first 100 elements of the Y array and put them into a 'Y Values for X > 0' array. ...And likewise with the negative X values, they should have a separate array of corresponding 'Y values for X < 0' array.
I can see that I should somehow save the indices of the positive X values from the large arrray wh
en I sort them out, and use those indices to pick out the elements from the main Y array with the same indices.
I just can't seem to set up the code necessary to do this. ...Can anyone help, please?
Attachments:
Poling_Data_Reader_5i.vi 79 KB
30BLEND.txt 3 KB -
Retriving data from a text file using vbs
Hi all,
Im relatively new at this, but want to delve right into it.
I need to look for a string of text in a log file.
When that string of text is found, I want to get the next 4 lines of text immediately after, see my example below:
Example found text string
first line after found string
second line after found string
third line after found string
forth line after found string
any help would be greatly appreciated,
thanks,
Fultz.
Have a good day.Here are a couple of alternatives:
strSearchFor = "Copy Optimization"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Scripts\lofile.log", 1)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.ReadLine
If InStr(1, strLine, strSearchFor, 1) > 0 Then
For i = 1 To 4
WScript.Echo objTextFile.ReadLine
Next
Exit Do
End If
Loop
objTextFile.close
'Alternative:
strSearchFor = "Copy Optimization"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Scripts\lofile.log", 1)
aText = Split(objTextFile.ReadAll, VbCrLf)
objTextFile.close
For i = 0 To UBound(aText)
If InStr(1, aText(i), strSearchFor, 1) > 0 Then
For j = 1 To 4
WScript.Echo aText(i+j)
Next
Exit For
End If
Next -
Query in schedule task adapter using FilestreamProvider
Hi,
Requirement: I need to use a dynamic file send port which appends the file every 2 hours after which is picked up by an ftp adapter on a daily basis on a fixed time.For
the above, I am using a scheduled task adapter to pick the from folder path( send port path) and via FTP adapter send to the destination.
Flowchart:
Direct Binding in Orchestration->Map-> Dynaminc File Send port-> File should be appended every two hour(for eg: suppose the file has to be picked up every day at 1pm,3pm: Until 1pm, all the files appended in the folder should be picked and
sent to the destination via schedule task adapter then the message should be deleted from the folder path then in between 1pm to 3pm how many every files come in should be appended aI have created a schedule task adapter using FileStreamProvider which should
pick files from a folder path in the interval of 5mins. The file gets appended every 2 hours and is sent to the destination. The adapter works fine but the file in the folder does not disappears after the schedule is over every 2 hours. Please provide
a resolution. nd send to the destination via ftp adapter and the file should be deleted from the folder path)->Picked up by schedule task adapter every 1 hour-> sent to the destination via FTP send port.
Problem:
I have created a schedule task adapter using FileStreamProvider which should pick files from a folder path in the interval of 2 hours. The file gets appended every 2 hours and is sent to the destination. The adapter sends the files at scheduled timee
but the file in the folder(i.e where the file sits after being processed by dynamic send port) does not disappears after the schedule is over every 2 hours and the content of the file is also not visible. Any kind of help would be appreciated.
Thanks in advance,
Ranjana>
Arpit Seth wrote:
> Hi All,
>
> We have an interface in which we are inserting data in Oracle server using JDBC Reciever Adapter.
> The interface ends up in error on adapter engine level whenever the we are sending long data in one of the field of target structure. The error which we get in communication channel monitoring is that "String too long", on googling i found that in oracle they solve such problem by making the field data type as CLOB.
>
> Thus can we define target structure field of CLOB type so that while inserting the data in Oracle server we never face the issue of this long string.
>
> Thanks
if the field contains very large data then yes, defining the target field in Oracle as a CLOB will solve your issue.
http://www.herongyang.com/jdbc/MySQL-CLOB-Overview.html
Maybe you are looking for
-
Can i use apple tv through my imac monitor?
can i use apple tv through my imac?
-
TS1424 serious error in iTunes registering system of Feed URL.
There is serious error in iTunes registering system of Feed URL. From yesterday, when submitting feed url, following error message has been occurred. " We are currently experiencing technical difficulties, please try again later. " all feeds is corr
-
HT3275 How to restore functionality
How to restore functionality when the follow Time Machine error message appears: The backup disk image "/Volumes/S.Time Caps/ MacBook Air.sparsebundle" is already in use. It was working fine until yesterday. Many thanks,
-
Since update to 10.5.6 can't write to XServe/XRaid
Since updating several Mac Pro workstations to 10.5.6 from 10.5.2 We can't write to our XServe/XRaid running 10.4.10. We can read files off the server but any attempt to write to the server results in the file copying 4 to 44kb of data then hanging.
-
Hi SAP Gurus this is kanna from Banglore i got one interview question yesterday i.e., they are asking me. Tell what is your system land scape ? i want Explanation for this question how to transport one server to another serve and how to transport wit