|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, May 09, 2012 10:43 PM
Points: 1,
Visits: 45
|
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Monday, September 29, 2008 5:10 AM
Points: 78,
Visits: 43
|
|
Good stuff about dealing with big files, but for the delimiter it's easy enough to set LF rather than CRLF in the file's connection object. I do this for data from a well-known provider of financial information which seems unable to standardize on CRLF or LF for its various files. Bill.
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Wednesday, April 20, 2011 8:50 AM
Points: 245,
Visits: 11
|
|
You could also achieve this result by a simple Shell script using RegEx-Replace and an ActiveX task before the actual transformation (dealt successfully with such things before)
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, September 07, 2006 7:45 AM
Points: 7,
Visits: 1
|
|
There are also two *NIX and DOS utilities to convert between the *NIX and DOS LF/CRLF formats. They are:
UNIX2DOS and DOS2UNIX
Simple, open source and widely available.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, March 19, 2013 6:40 AM
Points: 351,
Visits: 158
|
|
Yeah, I use UNIX2DOS & DOS2UNIX, very handy little utilities.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, January 10, 2006 6:58 AM
Points: 1,
Visits: 1
|
|
| or open the file in an editor like Testpad and save it in Windows format.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 8:28 AM
Points: 9,
Visits: 63
|
|
Nice article. I would have never thought to use SED on Windows for that purpose. I'll keep it in my favorites for just in case situations.
Thanks,
Edmond Shamon Larson
|
|
|
|
|
SSCrazy Eights
        
Group: Moderators
Last Login: Tuesday, April 09, 2013 12:53 PM
Points: 8,357,
Visits: 684
|
|
Great article. Fortunately I have not come across this yet but always keep this type of info around just in case. For me the biggest issue has been mainframe files where the columns are fixed width but the file truncates to the line when a particular coulmn is not there. For me it is simply to import the whole thing into a single char column then export back to a new file and run thru the import as originally design. Would be nice to have a tool to auto check this and fix the file or data (source code would be great so I could just make a DTS object) while importing. Anyone got such an animal per chance?
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, January 25, 2013 12:31 PM
Points: 209,
Visits: 550
|
|
Good article. I'll have to check out SED.
Regarding the bad record: if the record was embarassed, you could call it a rouge record. But I think you meant rogue.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: Monday, July 30, 2012 10:42 AM
Points: 3,434,
Visits: 519
|
|
Hi, Good article. The problem is even more general then just importing from UNIX-generated files. I had recently to show one of the business ladies why the data import jobs for her application done by the third-party SW fails based on what files another company sends her. I created 5 files generated by DTS, VBScript and export from Excel using different row and field delimeters to show her the file will contan delimeters that a particular programmer specifies. Also, I showed to her that if the Comments field contains one of her row or field delimier characters her data import job will fail too with the message about incorrect number of fields. We all have to determine what are row and field delimeters before setting up any file processing and after that to work with the file supplier to make sure they don't change their processes and technologies to produce the files. Here is a part of the script that helps me to see what characters are used. It posts a message for each character (for the demo), re-write it to output into the file. Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:\Temp\Files\MyTextFile.txt", 1) Do Until objFile.AtEndOfStream strCharacters = objFile.Read(1) Wscript.Echo strCharacters & " " & Cstr(asc(strCharacters)) Loop
Regards, Yelena Varshal
|
|
|
|