-
Hi Don, So I have it working but my only problem now is that if the dollar amount is not in the Hundred Thousands it does not split the text correctly. Do you have any ideas to accommadate different dollar amounts? Text Line I am searching for: "Total Bills Exported:,*" Actual Sample text line from Report: "Total Bills Exported:,496,Exported Amounts:,$555,607.27,$255,943.78" Script that works for dollar amounts greater than 100K: $RESULT=GET-CONTENT "PATH_TO_FILE\file.csv"
-
ya im almost at that point of giving up on a work-around. Can you give me an example of the syntax i would use? Thanks Again!
-
Hey Don, At this point im just looking for a quick dirty fix to this. Question for you is how can i just search for a . and any 2 numbers following the . and append a " after that.
-
Thanks Don.... you are 100% right, switching to Perl. Always appreciate the help and responses.
-
Hi - I have a csv file and toward the end of the file i have a line that reads "Total Bills Exported:,496,Exported Amounts:,$555,607.27,$255,943.78" What I need to do is replace the text so there is "" around the two dollar vaules, how do i achive this? The desired output would be: Total Bills Exported:,496,Exported Amounts:, " $555,607.27 " , " $255,943.78 " Any help would be greatly appreciated.
-
The CSV file is created automatically from our application. A recent update to the application code does not place the quotes around the dollar values. Our customer who receives the CSV file, built a VB program to read the CSV file and extracts the specific line that starts with "Total Bills Exported:". And now that the quotes are not present their VB program does not interpret the line correctly. So what i want to do instead of having to wait for our developers to fix the code is after
-
That makes sense but the dollar amounts are Hundred Thousands ( $555,607.27 & $255,943.78) when i ran your code i get the following: Total Bills Exported:,496,Exported Amounts:,"$555","607.27" What i need it to reade is: Total Bills Exported:,496,Exported Amounts:,"$555,607.27" Any thoughts? Thanks!
-
Not sure what it is, spent last night trying to figure it out but if you modify your two txt files (1.txt & 2.txt) so that 'One', 'two', 'three' and 'three','four','five' are all on ONE line then you get the following: PS C:\> select-string -path c:\*.txt -SimpleMatch -Pattern 'one','three','five' 1.txt:1:one two three 2.txt:1:three four five What i would like it to return is this: 1.txt:1:one 1.txt:1:three 2.txt:1:three
-
Select-String -Pattern (Get-Content C:\path_to_search\strings.txt) -Path (Get-ChildItem) -List -SimpleMatch Hi Don, Just found a problem and need your advice, when using the script above i realized the following: Say strings.txt contains 2 lines of data: Line1: 123 Line2: 456 When the script runs and searches through the files, if 1 file contains both search strings, it only returns the match for the first line in strings.txt. Ive tried removing the -List command as well as adding in -AllMatches
-
Thanks Don I am still at the beginning stages of getting myself familiar with PS and realizing every day how "powerful" this tool is. I can't thank you enough for the help and the quick reply, the runtime went from taking over 1 1/2 hours down to about 9 minutes, ha ha i quess that shows how new i am to PS and the reason for my username. - Until next time, and there definitely will be a next time!