Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

File need to be read in different formats( Tab formatted, commas separated)

Hi All,

I am reading an input text file which can be in any of the format like tab formatted, commas separated or fixed format. How can i write a code to make it work for all these file format other than writing separately for the above three cases. Kindly suggest.



Former Member

As far as seperators are concerned you may read entire file to stirng table, then identify separator (i.e. if you find tab mark, you assume it is tab separated; if you find ";" mark you assume this is a column separator). Use SEARCH or FIND statement and then (after having the separator) loop at string table and split each entry at this separator. If none of the above was find (no separator or fixed one) split according to given fixed format.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question