I have an array. I want to remove the first few words and then split the array by space so I can add it to an excel sheet or a datatable.
The array is read from a PDF.
This the array:
“U T GENERAL ACCT 123456789 Monthly, Billed 0.00000* 0.00000* $12,729,861.00 $11,494,538.00 $11,498,538.00 $0.00”
What I want:
“123456789
Monthly, Billed
0.00000*
0.00000*
$12,729,861.00
$11,494,538.00
$11,498,538.00
$0.00”
I want to separate those then add to an excel sheet.
Right now, I am taking the array, using regex to get the first words only, replacing them with a space.
I am not sure how to put that back in the array, so I can trim and then split by space? Any ideas?
Attached workflow. I attached one previously but I think it didn’t fit your needs.
With this workflow you will find the position of a giving string in an array and you will give the method skip this position. It will skip every word until it finds a given word.test.xaml (6.7 KB)
You can also just just pass an integer to the method if you know the number of words that you want to delete.
You have to have a defined set of steps if you want to do normal programming. Either know: how many words you want to delete or on which key word you want to stop and cut . Other wise you will need to do a machine learning workflow.
Here is the array of strings, It came from a PDF, I split the string to get the table. For each item in the string, I need to remove the first set of words, place the rest in a way that I can put it in a datatable, each in its own column (monthly, billed should be in the same column)
I apologize. I have been under the weather. I tried it today and it almost works. Please see below for the input and the output.
Input String:
UT RESEARCH FOUNDATION 1234567 Monthly, Direct Debit 0.21000* 8.00000* $5,166,796.00 $5,164,388.00 $5,164,388.00 $0.00
Output:
UT
RESEARCH
FOUNDATION
1234567
Monthly,
Direct
Debit
0.21000*
8.00000*
$5,166,796.00
$5,164,388.00
$5,164,388.00
$0.00
I will need Monthly, Direct Debit together, so I can put in the same cell…
sorry, I’ve been kind of busy with work but if you check your data you will see that monthly is the word that defines where to split the string. You just have to add a position to left on the array that has already been created in the previous workflow. What you can do then is use a regular expression since this words will not contain a number but the rest will. So you can add every word without a number to the same cell and the rest leave like the workflow shows you.
Regards