Hello-
I have an interesting problem. We are extracting data from one DB (Oracle) and need to insert it into another DB (MSSQL). Data transformation is not possible in this manner. B/c of the situation, we will need to dump the data to a spreadsheet/text file and load it into the MSSQL database. My problem is this. In ODB, the street_address field is one field. In the SDB, the street address field is address1 and address2, if there are two lines of address.
example is:
123 business way
ste. 456
My problem is in transforming this data to two fields. The problem where I think AWK can help me is that the data in the street_address field is separated by a newline (\n). At the end of each row is a dos newline/carriage return (\n\r). I need to change the \n that exists within the street address into a tab (\t) in order to use it as two fields. Is this possible with AWK, is there a better way to do this? I would appreciate some help with this one, or somebody to point me in the right direction to accomplish this task. I am using cygwin at work, but I can always do this at home on a BSD or Linux machine.
Note- trust me when I say this is the only way we are able to move the data from one to another.
data sample
Kevin\t123 cherry way\nApt 21\thouston\tTX\n\r
In the database this is 4 fields (name, street, city, state). This is obviously not how it appears in notepad or anything, just an idea of the tab, newline, and carriage return situation. I have about 2200 rows to move so manually is not an option.
-Kevin
I have an interesting problem. We are extracting data from one DB (Oracle) and need to insert it into another DB (MSSQL). Data transformation is not possible in this manner. B/c of the situation, we will need to dump the data to a spreadsheet/text file and load it into the MSSQL database. My problem is this. In ODB, the street_address field is one field. In the SDB, the street address field is address1 and address2, if there are two lines of address.
example is:
123 business way
ste. 456
My problem is in transforming this data to two fields. The problem where I think AWK can help me is that the data in the street_address field is separated by a newline (\n). At the end of each row is a dos newline/carriage return (\n\r). I need to change the \n that exists within the street address into a tab (\t) in order to use it as two fields. Is this possible with AWK, is there a better way to do this? I would appreciate some help with this one, or somebody to point me in the right direction to accomplish this task. I am using cygwin at work, but I can always do this at home on a BSD or Linux machine.
Note- trust me when I say this is the only way we are able to move the data from one to another.
data sample
Kevin\t123 cherry way\nApt 21\thouston\tTX\n\r
In the database this is 4 fields (name, street, city, state). This is obviously not how it appears in notepad or anything, just an idea of the tab, newline, and carriage return situation. I have about 2200 rows to move so manually is not an option.
-Kevin