What Lars suggested was a good start. He also asked for a sample of your code to see what it is you're currently doing.
If you're having trouble not getting records in your output, I'd start with a small file, as Lars suggested, and run the code through the debugger to see if your condition is being triggered accurately. If it is, but you're not getting output, you need to determine why. If not, you need to work on that criteria first.
------------------------------
James E. (Jim) Berube
Technical Account Manager (TAM) - Specialist, IBM Expertise Connect, IBM Expert Labs
IBM Software
------------------------------
Original Message:
Sent: Mon November 20, 2023 11:41 AM
From: Ade Odelana
Subject: Delete string in CSV file
Any replies from anyone please?
------------------------------
Ade Odelana
Original Message:
Sent: Sun November 19, 2023 11:38 AM
From: Ade Odelana
Subject: Delete string in CSV file
Hi Lars, thanks for your response.
Eiffel is in the 6th field, not the 9th field.
The first 5 entries in the CSV are:
p1;p1_z;1;usa;colorado;national museum;Paul;
p2;p2_z;2;france;paris;Eiffel;Colin;
p3;p3_z;3;brazil;sao paulo;luz station;Matthew;
p4;p4_z;4;canada;melbourne;Eiffel;Andrew;
p5;p5_z;5;germany;cologne;kolner dom;Martin;
I want only the records with Eiffel to be output into the output CSV. The record numbers (3rd field) need to be updated. For example the output for the above CSV will be:
p2;p2_z;1;france;paris;Eiffel;Colin;
p4;p4_z;2;canada;melbourne;Eiffel;Andrew;
------------------------------
Ade Odelana
Original Message:
Sent: Thu November 16, 2023 02:40 AM
From: Lars Dehli
Subject: Delete string in CSV file
Hi!
Have you tried writing any ESQL for this? If so, you can paste it here and we can look at it for you. If you haven't even started, then I would write something like:
- Loop through all records from InputRoot
- Add an IF statement to match your criteria.
- IF true then copy the current record to output
Have you checked in f.ex debugger that the file is read (into IIB) correctly?
Another tip : When I work with CSV files, I normally make a copy of the file with only f.ex 5 lines. Makes debugging much easier if the file is big.
Also - FYI: I think IIB 10 is no longer supported.
------------------------------
Lars Dehli
Original Message:
Sent: Wed November 15, 2023 10:17 AM
From: Ade Odelana
Subject: Delete string in CSV file
I have a few "Eiffel" entries in the 9th column in a CSV file. How would I write ESQL code for the Compute Node to delete the records / rows which do not have the "Eiffel" entries and then output the result to a new CSV output file. The IBM Integration bus version is IIB version 10. I have specified the filename pattern for the CSV file in the FileInput Node but I get no results in the FileOutput Node. Thanks.
------------------------------
Ade Odelana
------------------------------