02-17-2006 12:46 PM
hi,
i need to split the flat file. the flat file is a csv format. i will show u one example of the test data for the flat file. I know for csv file we can split it using comma but the real problem is that the text <b>'To, existing plumbing and mechanical engineering installations Take off gutter of any size; securely refix brackets; refix existing gutter, remaking joints metal gutter</b>
contains , ; into it, that is where i am facing a problem.
eg for the flat file:
50000283 112B To, existing plumbing and mechanical engineering installations Take off gutter of any size; securely refix brackets; refix existing gutter, remaking joints metal gutter 1 m 12/1/2005 6.04
how to seperate this these flat file
02-17-2006 1:29 PM
02-17-2006 1:29 PM
02-17-2006 2:15 PM
This is always a problem with CSV files. The only suggestion i can give is to change it to tab delimited file or use some other characters as separaters like '/' which may not be used as data in the file. So you can split at these characters and populate your data.
02-17-2006 2:10 PM
The sample that you gave does not look like a true CSV file.
50000283 112B To, existing plumbing....
I am guessing that 50000283 is a column, 112B is a column and then your text starts.
A true CSV file should be formatted:
50000283,112B, To, existing plumbing...
And to be truly correct with a CSV format, the fields should have double quotes around them so that you don't run into the issue of having commas in text intrepreted incorrectly:
"50000283","112B", "To, existing plumbing..."
When dealing with these types of text in a file, you need to be able to determine when the text begins and ends.
Chris
02-17-2006 2:18 PM
Hi,
get the data into one variable and replace unwanted characters with space or comma according to your requirement. then use split operation.
code sample :
data : x_line(1000) type .
REPLACE ALL OCCURRENCES OF ';' IN x_line WITH ' '.
REPLACE ALL OCCURRENCES OF ';' IN x_line WITH ','.
Laxman