Extracting a datetime string from a string multiple times
Hi,
I have a string like this:
1/9/2014 8:59:12 AM 7890565 666 1/10/2014 8:46:12 AM 6795007 546.........
I need to extract the datetime values that appear multiple times into a StringArray.
I found the following code that uses regular expression:
Matchm =
Regex.Match(inputString,@"\d{1,2}[-/\.]\d{1,2}[-/\.]\d{4}\s*\d{1,2}:\d\d(:\d\d)?");
It works fine but returns only the first datetime.
How can I enhancethe code to extract all the datetimes to a StringArray ?
Use the
Regex.Matches
Method = all occurrences instead of
Regex.Match Method for only the first occurence.
Olaf Helper
[ Blog] [ Xing] [ MVP]
Similar Messages
-
I am trying to print a snapshot taken from a PDF multiple times on one page.
Reader Will not print multiple copies of a snapshot on one page. I read the help files for Acrobat itself and all it said was take the snapshot and print it. Does anyone know if Acrobat can print multiple copies of the snapshot on one page?
From some reading in another forum page it looks like Acrobat can do it by saving the snapshot repeatedly with different names and the printing all of them at once. I really hate that workaround as I need to do this often.
Message was edited by: duckles10I tried to do it using Reader. I have a one page PDF document with a UPS shipping label on one side and a special box label with a barcode on the other. This is designed to print on a standard 8.5 x 11 sheet of paper. There are many times when I need to be able to print the box labels more than once. At home, I do it by taking a snapshot of the box label and printing it to a Label printer as many times as I need it. The distributor who also ships items for me only has a full page printer but he can print 4 on a page labels on UPS provided stock. Reader won’t print a snapshot multiple times, the option is grayed out. What I wanted to know is if Acrobat itself can print that snapshot multiple times. I don’t think it can without being able to cut and save that PDF multiple times as separate files. That would be a slow and cumbersome operation. If it would take a snapshot or a single cut and save and print that PDF 4 times on a page it would be a reason to spend the money to buy the program because we need to perform this operation OVER and OVER on a regular basis. On some shipments we might need to print 12 or more extra box labels. We tape smaller boxes together for one UPS label and need to make sure EACH box gets a separate label. Otherwise they sometimes get lost on the other end.
Doing the save 4 separate PDFs process we might actually need TWO copies of Acrobat unless reader can print 4 on a page if it has 4 PDF’s to work from. I have not yet found a good way to save those snapshots from reader. I have tried since I found that it was possible to cut and save them in other formats but not PDF’s as reader can’t save them. The quality of the saved items in other formats is not acceptable. I recently discovered that Microsoft publisher which I have can save a document as a PDF. I’m going to see if I can import to that program next. -
Jabber for Windows 10.5 shows contacts from Address Book multiple times?
What would cause Jabber for Windows 10.5.1 to show a contact multiple times from the address book when searching? See attached screenshot.
I tried removing firefox and rebooting/reinstalling Jabber with no luck. I reimaged my machine and loaded 10.5.2 fresh install with no previous versions and still getting the random crash. Also, I have users who say it has crashed on them during a WebEx and have had installation problems when upgrading from 9.x to 10.5.x. Version 9 is very solid, sticking with 9.7.5. I have about 10% of my test users having varying problems with version 10.5.x, waiting till the next release. Hopefully Cisco will spend a few more weeks testing the next one before publishing it on their site.
--edit--
Also, when you finally get frustrated and want to downgrade, Jabber 10.5.x doesn't uninstall completely and you end up with an error like the image attached when you try to install v9.7.5 for example and can't install Jabber even after rebooting. I had to run Microsoft Fix It install/Uninstall option and tell it to uninstall Jabber before Windows allowed me to install an older version of Jabber. Not too happy with this release. Strange enough though, some of my users have the exact same laptop I do, same windows build, same patches, etc, and it works fine for them. Anyway, not deploying this one. Good luck. -
I am attempting to take a path item that is on its own layer and change its color multiple times, saving it each time.
I was able to do it with javascript however can't get it to work in applescript.
Javascript:
(Items are already selected that I intend to change.)
var iL = app.activeDocument.pathItems.length;
var colorSwatches = app.activeDocument.swatchGroups.getByName('newColors');
var allColors = colorSwatches.getAllSwatches();
var colorNames = Array();
for (var i = 0; i < allColors.length; i++){
colorNames.push(allColors[i].name);
for (x = 0; x<colorNames.length; x++)
var currentColor = allColors[x].name;
for (i=0; i<iL; i++)
var myItem = app.activeDocument.pathItems[i];
if(myItem.selected)
myItem.fillColor = app.activeDocument.swatches.getByName(currentColor).color;
(I then go on to save each one)
When trying to cross over into applescript I have the following so far:
set iL to count every path item of document 1
set colorSwatches to swatchgroup "newColors" of current document
set allColors to get all swatches colorSwatches
set swatchCount to count every item in allColors
repeat with i from 1 to swatchCount
set currentSwatch to item i of allColors
repeat with x from 1 to iL
set myItem to path item i of document 1
here is where I have no idea what I am doing... I can't figure out how to test if an item is selected
if myItem's has selected artwork is equal to true then
set fill color of myItem to {swatch:currentSwatch}
end if
end repeat
end repeat
Or better yet is there a way I can select every path item of a layer and change its color that way?
Something like the following:
set fill color of every path item of layer "art" of document 1 to {swatch:currentSwatch}
Thanks for any input!I'm throwing it into a Applescript OBJc project I am working with. I currently have it in a javascript file within the actual project however this is the slowest part of my project and I'm going to attempt to speed it up some.
Let's say I'm changing the color of a path item 35 times... this starts to eat a ton of time up.
My applescript save illustrator file as jpeg is much faster than the javascript one for some reason...
It's also something I have needed to do numerous times in the past and never got around to asking. -
TS1474 iTunes movies have to be downloaded from the cloud multiple times.
Since upgrading to iOS 7, movies and tv shows I download onto my iPad and computer keep disappearing into the cloud. I then have to download multiple times. I only use my iPad with wifi so it's really annoying. Not sure if I have the setup wrong.
Hi,
Your main computer will have your original tracks. All your synced devices will have the matched/uploaded versions.
To get the benefit of the upgraded tracks on your main library, you need to delete the original and then download the matched version. You don't need to do anything with uploaded songs.
Ps make sure you have a backup of your original songs.
Jim -
Read from text file multiple times
Hi!
Inside my main VI, I read settings from the same text file like 4-5 different places (some inside sub VI's). This is also inside a while-loop that is delayed about 0,5 seconds. The text file contains about 50-100 lines depending on the settings. My question is if this can make the program unstable or loose it's performance???
Is it better to drag wire in all around the VI and subVI's ??
Best regards
Martin
Solved!
Go to Solution.Simple way is to use functional global.
Read text file at the start of the program, store it in Functional global.
Use it to read setting anywhere anytime...
If you don't know about functional global here is the link.
Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved. -
How to I stop iTunes from reloading what was on the iPad instead of what I have selected? Summary screen shows "Sync only checked songs and videos" Music has only the selected playlist. All songs were deleted from iPad by swiping them to the left and hitting delete (very time consuming). Sync is set to manual. However whenever I hit Sync, the old music gets put back on the iPad. I have had this happen at least 6 times.
Solved it. "Automatically fill free space with songs" was checked on the Music page. Worked perfectly once this was unchecked.
-
Returning a sting multiple times
Can anyone tell me how I can make a method print a string multiple times based on user input? e.g. string TEST and Keyboard.readInt(10)
result
test
test....test 10 times
Thanksuse a loop.
-
DB Adapter: Polling For New Records returns the First record multiple Times
I Polling for New or Chnaged Records against DB2 on iSeries. The DB Adapter returns the first record from the Table multiple Times. If the Table has 5 records it displays the first record 5 times. I am using BPEL 10.1.3.1 Can anyone help me with this.
Hi there,
please check out the DBAdapter trouble-shooting guide:
http://download-east.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/app_trblshoot.htm#CIHFEHFA
I am copying an entry from there into here:
A.1.21 Some Queried Rows Appear Twice or Not at All in the Query Result
Problem
When you execute a query, you may get the correct number of rows, but some rows appear multiple times and others do not appear at all.
This behavior is typically because the primary key is configured incorrectly. If the database adapter reads two different rows that it thinks are the same (for example, the same primary key), then it writes both rows into the same instance and the first row's values are overwritten by the second row's values.
Solution
Open Application Sources > TopLink > TopLink Mappings. In the Structure window, double-click PHONES. On the first page, you should see Primary Keys. Make sure that the correct columns are selected to make a unique constraint.
Save and then edit the database partner link.
Click Next to the end, and then click Finish and Close.
Open your toplink_mappings.xml file. For the PHONES descriptor, you should see something like this:
<primary-key-fields>
<field>PHONES.ID1</field>
<field>PHONES.ID2</field>
</primary-key-fields>
Thanks
Steve -
How to extract the Datetime from string?
Hello FOlks,
I have the sample data whichi is a string and it contains DateTime part inside it. I worked through half way but am not sure how to get the other part.
The sample data is
Note Added by AARON HILTON at 05/26/2010 14:53 MONEY NOTE ENTERED
Note Added by DEBBIE BILL at 11/16/2009 23:12 MONEY ENTERED
I tried using
substr(d.assignee_note, INSTR(d.assignee_note,'at')+2,length(d.assignee_note)) but it did not have the desired results.
How to just extract the datetime part i.e. 11/16/2009 23:12If your sample data is representative for all the data, you could also try a regular expression:
SQL> -- generating sample data, pretending it's stored in a column called str in a table called t:
SQL> with t as (
2 select 'Note Added by AARON HILTON at 05/26/2010 14:53 MONEY NOTE ENTERED' str from dual union
3 select 'Note Added by DEBBIE BILL at 11/16/2009 23:12 MONEY ENTERED' from dual
4 )
5 --
6 -- actual query:
7 --
8 select trim(regexp_replace(str, '[[:alpha:]]')) str
9 , to_date(trim(regexp_replace(str, '[[:alpha:]]')), 'mm-dd-yyyy hh24:mi') dt
10 , to_timestamp(trim(regexp_replace(str, '[[:alpha:]]')), 'mm-dd-yyyy hh24:mi') ts
11 from t;
STR DT TS
05/26/2010 14:53 26-05-2010 14:53:00 26-05-10 14:53:00.000000000
11/16/2009 23:12 16-11-2009 23:12:00 16-11-09 23:12:00.000000000
2 rows selected.where column STR is, well, a string, DT will turn your string into date datatype and TS will turn it into a timestamp.
It isn't clear how you want to extract the datetime part, but it really matters... -
Extracting body with header and trailer multiple times from a multirow file
Hello Everyone,
I am new to OSB and currently working on a project where I need to extract data from a flat file containing multiple rows of body and a single header and trailer in the following fashion:
Original File:
<Header></Header>
<Details></Details>
<Details></Details>
<Trailer></Trailer>
Desired format using OSB:
<Header></Header>
<Details></Details>
<Trailer></Trailer> ... in a single file, multiple times
Please help me in carrying out this functionality. It's really urgent and important.
Thanks,
SaurabhSome may argue this is not the right forum - database general might have been a little been than downloads - but now the thread is here I'll try an answer.
As I see it It depends on your spooling tool.
Lets assume you are using sqlplus.
I that case the sql prompt command may serve your purpose
Alternatively
select 'header' from dual
union all
select field1||','||field2||','field3 .... /*must single string expression but may concatentate field */ from somtable
union all
select 'trailer' from dual;may suit.
However I fear either I have not understood the question or if I have understood the question that you may have difficulties implementing this.
Edited by: bigdelboy on 19-Apr-2009 14:32 -
Parse xs:dateTime String as Date
Hi all,
I have to parse a xs:dateTime String (such as "2005-10-27T16:18:06.421+02:00") into Date. I have tested the next piece of code:
String timeString="2005-10-27T16:18:06.421+02:00";
DateFormat dateFormat = new SimpleDateFormat("'-'?yyyy'-'MM'-'dd'T'HH':'mm':'ss('.'S+)?(zzzzzz)?");
Date date = dateFormat.parse(timeString);but it throws the following exception:
java.text.ParseException: Unparseable date: "2005-10-27T16:18:
06.421+02:00"
at java.text.DateFormat.parse(Unknown Source)
Could anybody be so kind as to tell me how getting a Date from a dateTime string, please?
Thank you very much in advance.First of all, thank you very much for your request.
It has been very useful.
When getting a dateTime using:
String
timeString="2005-10-27T16:18:06.421+02:00";
DateFormat dateFormat = new
SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");I obtain the following, as you have written:
"2005-10-27T16:18:06.421+0200"
However, this is not compliant with dateTime defined
in XMLSchema (http://www.w3.org/TR/xmlschema-2/),
because the time zone does not contain ":". Is there
any way of getting a date-time compliant with
xs:dateTime? if not, should java consider it?
Thank you very much in advance.I do not know much about XMLSchema but I will take your word for the date/time definition - as far as I can see there is no time zone in SimpleDateFormat that complies with this format exactly.
You could create the string by adding the ':' or parse it by removing the ':' as in my example; but, I do not see a way to do this directly.
You might want to search to see if there is a bug report out there or maybe some other discussion on this topic. -
DateTime String array in Graph
Greetings.
I tried to plot DateTime string array VS Numbers array with no success in the XY Graph object.
I even converted the DateTime string array to DateTime type using the VI called "Convert_String_to_TimeStamp.vi" with also no success as the X (Time) is just very big numbers and a datetime format.
Please check the attached shot, it will describe the situation clearly.
Thanks in advance
Ayman
Ayman Mohammad Metwally
Automation Engineer
Egypt - Cairo
Solved!
Go to Solution.
Attachments:
Graph.JPG 93 KBYou could read the file line by line and use the scan from sting function to convert to a timestamp.
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness -
I have a string of max length 40 characters. The string may contain 20 characters also with remaining 20 characters as 'SPACE'. Now from this string i want to fetch last four characters only
e.g. If my string contains " ABCDEFGH ", then from this i want to fetch only last 4 characters i.e. "EFGH" only.
How do i do it???Hi,
You can do this using the offset.
E.g
Var1 = 'abcdefgh'
then
Write: Var1+0(4).
this will extract the four characters from begining.
Regards,
DS -
Extracting 24 hour timestramp from sysdate
Hi All,
I have some 24 hour times stored as strings in a table eg 16:00, 18:30 , 04:00 ect
I'm trying to extract the 24 timestamp from SYSDATE so that I can do a comparision such as:
IF (just need timestamp from sysdate in 24 hour format here) > TO_DATE(r.wave_finish_time,'HH24:MI') THEN...
ANy ideas on how to extract the timestamp from sysdate in 24 hour format?
Cheers in advance!
Regards
SatThis will give you an idea (apart from the suggestions already offered).
If not, let us know.
SQL> with some_time_strings as (
2 select '01:00' my_time from dual union all
3 select '02:00' from dual union all
4 select '03:00' from dual union all
5 select '04:00' from dual union all
6 select '05:00' from dual union all
7 select '06:00' from dual union all
8 select '07:00' from dual union all
9 select '08:00' from dual union all
10 select '09:00' from dual union all
11 select '10:00' from dual union all
12 select '11:00' from dual union all
13 select '12:00' from dual union all
14 select '13:00' from dual union all
15 select '14:00' from dual union all
16 select '15:00' from dual
17 )
18 select *
19 from some_time_strings
20 where my_time > to_char(to_date('01-01-2009 04:50', 'dd-mm-yyyy hh24:mi'), 'hh24:mi');
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
11 rijen zijn geselecteerd.Explanation in short:
to_char(to_date('01-01-2009 04:50', 'dd-mm-yyyy hh24:mi'), 'hh24:mi');
means
=> to_date('01-01-2009 04:50', 'dd-mm-yyyy hh24:mi') = the date part, could also be sysdate or any DATE
=> to_char( the date part, 'hh24:mi'); = the VARCHAR2 FORMAT part, you really need to use that, since your 'time' is in fact a string.
Edited by: hoek on Apr 17, 2009 6:51 PM added some extra words, because of the weather
Maybe you are looking for
-
Help NOT downloading apps to iTunes on my PC
I have three girls ages 9, 11 and 13. they each have iPhones or iTouches and download a whole lot od what I call "CRapps". We use a single itunes account because I want to be able to guard against explicit lyric songs and age-inappropriate games, e
-
TS3694 hi my name is joe im having a problem restoreing my phone and this error keeps coming up 1015
i am having a problem restoring my iphone 3g
-
Problem with CALL TRANSACTION SKIP FIRST SCREEN
Hi Experts, I am having a functionality where in if i click the hotspot i go the specified transaction..I am able to do that using -- CALL TRANSACTION 'CAA3' AND SKIP FIRST SCREEN Now if i press the back button on the standard transaction i am coming
-
Runtime error when starting illustrator CS2
I have creative suite cs2 on my windows xp computer and illustrator has been acting kind of funky lately. Now Illustrator CS2 won't even start up. A Runtime error comes up. It says Runtime Error! Program: ...rator CS2\SupportFiles\contents\Windows\Il
-
FInd/search function in PDF view application still not fixed in WebOS 1.4. In PDF View application: 1) The field where you enter something to search/find is hidden by the name of the PDF document title. It doesn't go away even when you start typing