Read file latest entry with time stamp from unix
Hi
I have a log file which is being generated with an entry like this
Product20080228185707,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
Product 20080229151029,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
Product 20080320163241,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
Product 20080229151111,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
I know how to read the file from Unix but How do I pick the entry with latest time stamp ?
Please help urgent
thanks
Hi,
Do like this.
1. Declare table with two fields as name(255) type c, timestamp(14) type n.
2. Loop at your entries and push entry name in name field and time stamp in timestamp field. You can move time stamp as: move file+7(13) to timestamp.
3. So your new internal table will have entry names and timestamp.
4. Now sort itab by timestamp descending.
5. Read itab index 1.
this will give you latest entry from unix.
i hope this helps,
Ags,
Similar Messages
-
Read file : File name conatins the Time stamp from payload
Hi
I have to scenario where i am creating file name based on the payload field ( Date/time), theni have to pick up the files based on the File Name :
Ex: 0212200910:01:02
0212200910:01:03
0212200910:01:01
then the sender adapter should pick up the file 0212200910:01:01 file first and 0212200910:01:02 second
0212200910:01:03 third ...
the sender adater pick up files based on file name i.e Timestamp
how to achieve thatHi,
In the Sender File Adapter, goto Processing Tab and change Processing Sequence to By Name.
Regards,
Balaji.M -
How to read multiple Digital samples and plot a chart with time stamps
Hi,
Could anyone send me a code that:
1. Reads 'multiple samples(lets say 4) from single digital input'
2. 'plot digital data as a chart with time stamps'
3. Find frequency
4. Log data into file with time stamps
I have attached the code which i tried.
Thanks,
LK
Attachments:
DigitalNSample.vi 27 KB
DigitalNSample.vi 27 KBHi,
Could anyone send me a code that:
1. Reads 'multiple samples(lets say 4) from single digital input' using NI USB 6009 or NI USB 6251.
2. 'plot digital data as a chart with time stamps'
3. Find frequency
4. Log data into file with time stamps
I have attached the code which i tried.
Thanks,
LK
Attachments:
DigitalNSample.vi 27 KB -
Hi,
I am new to Labview. This question might be a joke to some of you here, but any help would be greatly appreciated. I have a spreadsheet with time stamps and power outputs from a generator. I am supposed to calculate the difference between consecutive time stamps, which will act as a delay for the next power output update that needs to be sent. For example, lets say that I have to following data:
Time Stamp Power Output
11:00:00 AM 3kW
11:00:02 AM 2.9kW
11:00:04 AM 3.2kW
11:00:06 AM 3.1kW
The above data doesn't make any sense, but it is just for the purpose of this question.
So, I have to read 11:00:00 AM and 3kW initially - 3kW is the initial request thatHello
you can simple subtract one time from the other one and so you get the difference. -> Example
Mike
Attachments:
Unbenannt 2.vi 8 KB -
Hi,
I am new to Labview. This question might be a joke to some of you here, but any help would be greatly appreciated. I have a spreadsheet with time stamps and power outputs from a generator. I am supposed to calculate the difference between consecutive time stamps, which will act as a delay for the next power output update that needs to be sent. For example, lets say that I have to following data:
Time Stamp Power Output
11:00:00 AM 3kW
11:00:02 AM 2.9kW
11:00:04 AM 3.2kW
11:00:06 AM 3.1kW
The above data doesn't make any sense, but it is just for the purpose of this question.
So, I have to read 11:00:00 AM and 3kW initially - 3kW is the initial request that is sent. Then I have toRepeated forum post
Please view http://forums.ni.com/ni/board/message?board.id=170&message.id=294435
Regards,
Juan Galindo
Applications Engineer
National Instruments -
Can someone help with a previous post labeled "Writing to a data file with time stamp - Help! "
Can someone possibly help with a previous post labeled "Writing to a data file with time stamp - Help! "
Thankswhats the problem?
Aquaphire
---USING LABVIEW 6.1--- -
File name for append processing mode with time stamp
Hi Experts
we are doing file to file scenario using the processing mode as Append.
the requirement for us to append the files and we need to have new file name with time stamp added to the appended file.but in the processing mode of the file adapter either we can append or add time stamp. thatz the problem I am facing now.
we are doing file based processing not message based ,micheal blog regarding the dynamic file name is for message based not for file based.
Please provide your valuable comments.
Thanks
FaheemHi mohamed,
I suggest you to map the target source structure to the required filename u want, like for example ur filename is input26062008.txt means to the target structure u perform the following mapping
constant (input) concat with currentdate function --> concat with constant .txt --> map this concat to target. So u will get the filename u expected with the time.
Then in the communication channel u select the mode as append. Now ur requirement will get solve i think so. plz try.
Regards,
Murugavel -
Hi All,
I using RFC to file scenario ,in this when file is created it folder it is coming with date and time stamp.but i am not using add time stamp in processing paramerts.i have checked the file name in communication channel monitoring it is coming without timestamp
but in folder file is getting created with time stamp.
RegardsHi Gangadhar,
In the receiver file adapter, under Processing tab, see the value of File Construction Mode.
This value should be Create instead of Add Time Stamp.
After making the changes save & activate the file receiver channel. The output file then will not have timestamp appended to its name.
Regards,
Gautam Purohit -
How to read a time stamp from the db without ".0" at the end
Hi All,
I have code that is saving the results of a query in a result set.
When ever i read a time stamp from the db (mysql 4) it always adds ".0" to the end of it.
I tried using the getTimeStamp, getDate, getString methods for result sets and was not able to resolve the issue.
Am i missing something here?
Thankshere is the code
public static Table executeSelect(Connection conn, String qry)
throws SQLException {
Statement stm = null;
ResultSet rs = null;
try {
stm = conn.createStatement();
rs = stm.executeQuery(qry);
Table t = new Table(rs);
return t;
} finally {
close(null,stm,rs);
Basically the user is asked to enter the query and the connection settings and then i retrieve the data and return a table.
Now if i try to print the value of the time stamp from the result set it adds a a .0
So for example if am running the following
select mod_ts from temp limit 1;
| mod_ts |
| 2007-12-28 09:32:58 |
1 row in set (0.00 sec)
When i print the value of the time stamp it gets printed as 2007-12-28 09:32:58.0
The following code is used to generate a table from the result set
public Table(ResultSet rs) throws SQLException {
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
colNames = new String[colCount];
colTypes = new int[colCount];
for ( int i=0; i<colCount; i++) {
String colName = rsmd.getColumnName(i+1);
colNames[i] = colName;
int colType = rsmd.getColumnType(i+1);
colTypes[i] = colType;
while ( rs.next()) {
if ( data == null) {
data = new ArrayList<List>();
List<Object> row = new ArrayList<Object>();
for ( int i=0; i<colCount; i++) {
Object ob = rs.getObject(colNames);
row.add(ob);
data.add(row);
Now when i print the values in the result set it adds a .0 to the end of the time stamp
I also tried using getTimeStamp for a result set and the same problem still existed -
WRT610N certain file types have wrong time stamp
Hi, I have searched this forum for a similar problem with no luck - so here goes...
I have a WRT610N router using the latest firmware 1.00.03 B15. After upgrading the firmware I reset router for 30 sec., and then powerdown for 30 sec. as I have read on this forum, and yes the USB drive was disconnected before hand, but I still have this problem when creating/saving certain file types on the USB drive attached to the router.
I have discovered that MS Word and PowerPoint files (.doc & .ppt) are saved with the correct date and time, but MS Excel, Notepad, and HTML files (.xls, .txt, and .mht) are saved with a time stamp that is one hour later!!! There may be other file types that are affected by this as well.
Example: I create/save a Word file and also an Excel file at 1:00 PM, When I use Windows Explorer to view the details of the files on the USB drive, the Word file has a timestamp of 1:00 PM, but the Excel file has a timestamp of 2:00 PM (in the future). All other functions on the router seem to be OK.
If I create these five file types on the C: drive they all have the same timestamps, I also have a Netgear SC101 NAS which shows the correct timestamps. I only have this problem when using the USB drive connected to the WRT610N. I tried this on 3 different computers - all have the same issue.
This may seem like a minor issue, but Im using SmartSync Pro to back up all the drives on the LAN and it uses the file's timestamp to determine if it should be backedup or not. So Im concerned that backups may not be done properly, or God knows what it will do with files from the future!
Im using WinXP SP3, the USB drive is a WD2500BEVS - 250GB with 4 partitions (largest is 120GB) all formatted as NTFS.
I would appreciate it if others would try this and post their results here so I would know whether to bug Linksys for a fix, or if I have problems elsewhere in my configuration. Thank you.Well, 15 days, 40 views, 0 replies.
Could one kind sole, just one, please; startup Notepad, save an empty .txt file to the USB drive on the router, and then let me know if the file had the correct time stamp?
Preferably someone with a ver 1 router, firmware 1.00.03 B15, and running WinXP SP3.
Thanks in advance. -
Save the file and give date & time stamp
1. Reading the Excel file from the selection screen as a parameter.
2. Using F.M. ALSM_EXCEL_TO_INTERNAL_TABLE reading Excel file into
Internal table.
3. Implementing the Business Logic.
4. Move output to Final Internal table.
5. Final internal table should generate a Flat file. By using GUI_DOWNLOAD.
6. That flat file should be saved with the name and location given in the Excel.
7. When ever I run the program output file will generate in the same location but with date and time stamp. Because Im running the program for range of employees say initially I run for 1 10,000 employees next 10,001- 20,000 like that.
Whenever I run for 2nd time it will overwrite the previous output, thats the reason Im using date and time stamp.
Eg:
PERSONAL Numbers Name Location
00000001 xxxxx-24.04.2007-10.30 C:\
00000002 xxxxx-24.04.2007-10.35
00000003 xxxxx-25.04.2007-10.40
00000004 xxxxx-25.04.2007-10.30
Can any one help me how to save the file and give date & time stamp through hardcode?
please help me in this issue.I am not clear with your problem. Based on the understanding of your question,
there can be two cases.
1- U want to insert time stamp in the output file.
2- Time stamp is already there, u just have to solve the overwriting issue.
If your question goes with option 2, You can make use of import parameters
<b>CONFIRM_OVERWRITE</b> : Which will ask for confirmation before overwriting.
<b>APPEND</b> : which you can choose either to append the data to the existing file or overwrite it.
Please inform if the issue is not resolved.
Message was edited by:
BINU RAJ BINU -
TDMS viewer not showing data with time stamp
Need help with time stamping data in a TDMS file generated by DAQ Assistant.
When I use the TDMS Viewer, with the x-scale set to absolute time, the date starts at 1903. If I use Excel to look at the file the start time is correct (i.e. 2013).
Solved!
Go to Solution.Bo_Xie, I have simplifed my VI and now able to display the correct time stamp. Thank for your time!
-
hi, is there a way to bounce with time stamp in logic? can logic automatically put time stamped files in the right place in the arrange window?
thx, wHi, Acmarie.
Thank you for visiting Apple Support Communities.
To see what time a message was sent or received. Drag any bubble to the left. Below, I have included the user guide which references this new feature on page 66.
iPhone User Guide
Cheers,
Jason H. -
i am upgrading my 2008 macbook to an ssd drive and want to save my settings. how do i save then? I have my files backed up with time machine ,but dont want to restore all files ,as there might be some junk backed up too. Help will be appretiated
When you restore from a Time Machine back up you can pick and chose what is restored. It is not an all or nothing process. Nor do you have to do the partial restores all at the same time. If days after the first partial restore you find something else you want you can restore just that.
-
Hi everybody,
I have a TCP/IP where I send datagrams (in c-code) to LabVIEW (which is the server).
The datagram sends with every data a time stamp in the following way: dd.mm.yyyy hh:mm:ss.zzz, where zzz stands for milliseconds. I would like to see my data in a waveform chart at the LabVIEW frontpanel, but I'm not sure how to get a continuous time stamp from the c-code. I tried it with "scan from string" (as my data enters LabVIEW as a string), and then I made a sum of the minutes (times 60) and the seconds, which works for one minute, but after one minute my time goes of course to zero again which isn't nice for the waveform chart...
Does anybody has a nice idea how to solve this? Any examples?
Thanks in advance!
SteffiThis code should help you,
I only have a problem to read the final '.' my localization set the ',' as decimal sign and I can't get LabVIEW to change the decimal sign in this parser.
Ton
Message Edited by TonP on 02-01-2008 10:00 AM
Message Edited by TonP on 02-01-2008 10:01 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Attachments:
ScanTime.png 2 KB
Maybe you are looking for
-
Re-installing Snow Leopard Registration Question
Hello, Is there anyway to get Snow Leopard's setup assistant to recognize my account registration information when re-installing? I go through the installation process as normal but after I input my username and password information the Account
-
Location of Parental Control files
Does any one know where this file is stored? I thought it would be in user>Library>Preferences>com.apple.systemprefs. I tested a modified file with no luck. Setting up for a computer lab in a school and want to have different settings for the differe
-
Hi guys, I am trying to record a transaction for test case, it was showing me error RELEASE HIGHER THAN 6.20 ARE NOT PERMITTED. pls explain me if there any setting need to be done to resolve issue? thank you with regards chaitan
-
A few days ago Safari has been taking up all the CPU time after it launches. Sometimes I can quit it, and sometimes I have to do a force quite. I don't remember installing anything recently. I am running Leopard and I just recently did a software upd
-
Compiling CS3 plugins on Xcode 5 or 6
I read in other discussion threads that you can compile CS3-CS4 plugins (the samples to begin with) in Xcode 6 DP now released. What changes are needed in the version of the odfrc-cmd that comes with CS3 SDK? Can I use the compiler from CS5? I always