flat-file

How do I retrieve only the top x rows from a flatfile in SSIS

╄→гoц情女王★ 提交于 2020-01-15 06:47:08
问题 I have a flatfile connection and I'm only interested in the first 10 rows of data. How can I just import the first 10 rows? Row sampling is random so I can't use that. Is there some way I can have some sort of derived column which is an automatic row number or something and then data-split to only keep rows with that id <= 10? Any help much appreciated! 回答1: I've used this component --> http://www.sqlis.com/post/Row-Number-Transformation.aspx The component creates a new variable with a row

How to manage giant fixed-width file in SSIS?

允我心安 提交于 2020-01-14 05:21:24
问题 I have a fixed width file that is about 1200 characters wide and has about 300+ columns. I'm looking for a way to create a fixed-width data source in SSIS without using the UI for the flat file connection manager. Is there a way to modify the column definitions without having to use the UI in SSIS? I can't find a file for the data connection anywhere in the project. Am I doomed to manually add 300+ columns into the flat-file connection manager one by one? 回答1: Two options come to mind. The

Unicode string to flat file from vba

此生再无相见时 提交于 2020-01-11 09:33:07
问题 I want to store a unicode string in a flat file on a windows box from an excel/vba macro. The macro converts normal string to unicode representation, need to store it in a file and retrieve later. 回答1: As mentioned, you can use the Microsoft Scripting Runtime (scrrun.dll). I have posted some examples below. Some people also like the native file IO features. There is an extensive (and fairly comprehensive thread) thread here: http://www.xtremevbtalk.com/showthread.php?t=123814 However for

SSIS ragged file not recognized CRLF

谁说胖子不能爱 提交于 2020-01-09 08:00:59
问题 In SSIS, I try to load data from a flat file. The flat file have fixed width columns, but some column are not present in a row (a column can have a CRLF, which must be a new line) like this a b c the first rowok<CRLF> iu jjrjdd<CRLF> this is a newline<CRLF> How I can have exactly the same number of line and exact data in my output? I setup a flat file connection, of ragged right type. In this sample, row 1 is correctly retrieve, but for row 2, it didn't recognize CRLF, and put in b column all

Dumping blob rows to files from MySQL

拟墨画扇 提交于 2020-01-06 07:26:51
问题 I have a table with a few thousand rows in it that has a few integer columns and a blob column. I want to dump each row out as its own file with the blob being the content and the integers being used to form the file name. This is a one time op so quick and dirty is OK. One constraint is that I have almost no tools installed in this enviornment so that will be part of the dev cost no matter what I use. Edit: I ended up using C# from another box. It only took downloading a single assembly and

Why are log files commonly flat?

冷暖自知 提交于 2020-01-06 03:03:06
问题 Are log files not meant to be read by machines but by users only? I wonder if there are file appenders for any logging framework that write their output to XML. 回答1: "Logging to XML" is quite a general requirement, because there is no such thing as the standard log file format. But since XML files are text files, which logging frameworks can write, and since many of those frameworks allow configuring log line format, I see no problem in defining your log output with XML tags of choice. For

SSIS 2005 - How to Import a Fixed Width Flat File?

☆樱花仙子☆ 提交于 2020-01-05 04:33:10
问题 I have a flat file that looks something like this: junk I don't care about \n \n columns names\n val1 val2 val3\n val1 val2 val3\n columns names \n val1 val2 val3\n I only care the lines with values. These value lines are all fixed width format and have the same line length. The other junk lines and column names can have any line width. When I try the flat file fixed width option or the ragged right option the preview looks all wrong. Any ideas what the easiest way to get this into SSIS is?

Ruby: start reading at arbitrary point in large file

▼魔方 西西 提交于 2020-01-01 07:05:14
问题 I have some log files I would like to sift through. The content is exactly what you expect in a log file: many single lines of comma separated text. The files are about 4 gigs each. File.each_line or foreach takes about 20 minutes for one of them. Since a simple foreach seems... simple (and slow), I was thinking that two separate threads might be able to work on the same file if I could only tell them where to start. But based on my (limited) knowledge, I can't decide if this is even possible

SSIS FlatFile Access via Jet

只愿长相守 提交于 2019-12-30 07:24:48
问题 Is there a way to access FlatFiles with the Microsoft.Jet.OLEDB.4.0 driver in SSIS ? The acces via the FlatFile Source is much better, it´s just about if there exists a way to do it with the Jet driver. 回答1: This seemed an interesting question so I piddled around a bit with it. Yes, you can definitely use the JET driver to read a flat file. HOW TO: Use Jet OLE DB Provider 4.0 to Connect to ISAM Databases See Open Text section By default, it expects the file to be a CSV but you can specify the

Can NHibernate persist to flat files instead of database?

亡梦爱人 提交于 2019-12-30 06:16:16
问题 Here is a curiousity question. I have an application that must support both flat files and the database as a place to persist data. I was thinking maybe using a .csv or tab-delimited set of files as input ... Is it possible to use NHibernate to write to do both persistance tasks? 回答1: Try using the Jet engine (see this) Dialect and other nhibernate settings should be the ones for Microsoft Access. 回答2: No not to the best of my knowledge. I have the same requirement and have ended up just