June 4, 2010 at 10:02 am
HI,
I have a huge flat file and i am not sure about the number of columns present in that. Is there any way to check / see the top 1..n rows from the Flat file ? Because i cudnt open the flat file since it is of huge in size.
Thanks in Advance!
June 4, 2010 at 2:52 pm
You could use bcp with -L option(last row).
Set the field terminator to a non-existing character in that file (e.g. ~ or °) and import it into a table with only one column (+ addtl. id column).
Use a split string function together with your field terminator to split the columns into rows. Based on the row number from your splitted data you'd know the number of columns.
Sounds a little quick-and-dirty but that's the way I'd do it if I'd have to import a flat file with an (at the moment) unknown structure...
But the question is: do you know for sure that the column structure you come up with is correct and will it be consistent for all rows once you start to import the large file?
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply