May 31, 2022 at 3:15 pm
Thanks for responses... I think the problem is data related... When I run the following query I finding some of the records starting with
/* and
/*
Where it's failing is the 4th record where the eye-catcher /* has a space before /*
Select * from
PSFileOrder
where
psfile not like '%:%' and psfile <> ' '
and psfile like ('% /*%')
May 31, 2022 at 4:31 pm
then its time for you to read the manuals - keyword TRIM
May 31, 2022 at 6:11 pm
I was able to fix the source that creates the jobs.txt and remove the space at the beginning of some of the records. Now The Code supplied by Jeff works as expected...
Thanks to you both and sorry for some of posts I really appreciate your help..
Jeff,
Will try to make sure I follow the rules and suggestions when asking for help.
May 31, 2022 at 7:46 pm
Do all of the files have a similar issue? Perhaps you need to tweak the code to handle the anomalies. Frederico offered a hint about that above.
And, no... they're not rules. They're just common sense. We can't help you if you come in and say you need help fixing the car but won't even provide a picture of the problem never mind let us look at the car. 😉
--Jeff Moden
Change is inevitable... Change for the better is not.
May 31, 2022 at 10:08 pm
Do all of the files have a similar issue? Perhaps you need to tweak the code to handle the anomalies. Frederico offered a hint about that above.And, no... they're not rules. They're just common sense. We can't help you if you come in and say you need help fixing the car but won't even provide a picture of the problem never mind let us look at the car. 😉
Edit... was in a hurry and misread your post. You fixed the issue at the source, which is an even better solution. Well done there!
--Jeff Moden
Change is inevitable... Change for the better is not.
May 31, 2022 at 11:38 pm
This was removed by the editor as SPAM
June 1, 2022 at 1:23 pm
I was able to fix the source that creates the jobs.txt and remove the space at the beginning of some of the records. Now The Code supplied by Jeff works as expected...
If you have control over the source creation why not just create it in a more usable format in the first place..... >.<
June 1, 2022 at 7:20 pm
Jeff Moden wrote:
Do all of the files have a similar issue? Perhaps you need to tweak the code to handle the anomalies. Frederico offered a hint about that above.And, no... they're not rules. They're just common sense. We can't help you if you come in and say you need help fixing the car but won't even provide a picture of the problem never mind let us look at the car. 😉
Edit... was in a hurry and misread your post. You fixed the issue at the source, which is an even better solution. Well done there!
If he can fix the output at the source - then it shouldn't be too difficult to fix that source to output data that is much easier to parse. Even if this is just being output from a bunch of print statements to a console - you can add a line of text output that is formatted as a delimited list of elements or even create a separate file.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
June 1, 2022 at 7:36 pm
Bruin wrote:I was able to fix the source that creates the jobs.txt and remove the space at the beginning of some of the records. Now The Code supplied by Jeff works as expected...
If you have control over the source creation why not just create it in a more usable format in the first place..... >.<
Major chicken dinner right there. 😀 It's funny, I had that same revelation just a wee bit ago and came here to post nearly the same words as what you posted above. Writing the data directly to a staging table would be even better but at least a more normal, "columunised" TSV would make life a whole lot easier.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 2, 2022 at 10:32 am
What I meant was after this file was generated I could alter the output to correct the issues. The initial creation of the file was some generated process from the App which I have "No Control".
thx
June 2, 2022 at 8:33 pm
What I meant was after this file was generated I could alter the output to correct the issues. The initial creation of the file was some generated process from the App which I have "No Control".
thx
Then that really isn't a solution to the problem - since you would need someone to manually 'fix' the file every time you want to process.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 11 posts - 46 through 55 (of 55 total)
You must be logged in to reply to this topic. Login to reply