Re: beginners question : how to import textfiles into databases
Posted in 1996
You can avoid the vi of the file by changing the delimiter from | to TAB.
You can change the delimiter by way of either the environment or right
in the load statement itself.
Env
===
export DELIMIDENT="\\t"
in SQL
======
load from "your-file" DELIMITER "\\t" insert into "your-table"
-Bill
}
} >
} > Here goes : how can I, using the dbimport tool get some tab-delimited
} > text-file data into my database ? (the file comes over from PC access
} > database)
}
} OK. You wouldn't use dbimport, you would use either dbaccess with a LOAD
} command or you would use dbload.
}
} The bluntest way to do what you want (because that's the way I approach remote
} support is:
}
} 1) vi your_raw_data_file
}
} 2) :1,$s/ /|/g
}
} (where the spaces above are a TAB)
}
} 3) save the file.
}
} 4) dbaccess dbname
} q
} n
} LOAD FROM your_raw_data_file INSERT INTO customer;
} [ESC]
} r
}
} HTH and good luck.
}
} --
} Ciao,
}
} Billy
}
} +------------------------------------------------------------------------------+
} | Billy Wheeler Chief Cook and Bottlewasher The West Solutions Group |
} +------------------------------------------------------------------------------+
} | (E) billy@west.co.za (U) http://www.west.co.za/billy.html |
} +------------------------------------------------------------------------------+
} | Microsoft Word 6.0a to your mother .... |
} +------------------------------------------------------------------------------+
}
--
Bill Ennis Voice: 312-474-7516
SSA Fax: 312-474-7460
500 W. Madison email: ennis@ssax.com